-
Notifications
You must be signed in to change notification settings - Fork 6k
Make installer work on any os/arch and add installer tests #3712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c31e72f
24f6834
6045fdd
3339853
4ffecd6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Installer integration | ||
code-asher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "installer.sh" | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
ubuntu: | ||
name: Test installer on Ubuntu | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install code-server | ||
run: ./install.sh | ||
|
||
- name: Test code-server | ||
run: yarn test:standalone-release code-server | ||
|
||
alpine: | ||
name: Test installer on Alpine | ||
runs-on: ubuntu-latest | ||
container: "alpine:3.14" | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install curl | ||
run: apk add curl | ||
|
||
- name: Add user | ||
run: adduser coder --disabled-password | ||
code-asher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Standalone should work without root. | ||
- name: Test standalone to a non-existent prefix | ||
run: su coder -c "./install.sh --method standalone --prefix /tmp/does/not/yet/exist" | ||
code-asher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
macos: | ||
name: Test installer on macOS | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install code-server | ||
run: ./install.sh | ||
|
||
- name: Test code-server | ||
run: yarn test:standalone-release code-server |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Script unit tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "installer.sh" | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
name: Run script unit tests | ||
runs-on: ubuntu-latest | ||
# This runs on Alpine to make sure we're testing with actual sh. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused, doesn't the script force things to run as bash due to the shebang? Also, Ubuntu should include Bourne shell (e.g. dash) too There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The installer shebang is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah! Good point, I was looking at This makes sense then. I think Ubuntu should be using dash for /bin/sh by default, though I'm not sure if GitHub Actions does some customization to the environment:
There's also a handy There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh that's dope! I'll definitely add that. |
||
container: "alpine:3.14" | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install test utilities | ||
run: apk add bats checkbashisms | ||
|
||
- name: Check Bashisms | ||
run: checkbashisms ./install.sh | ||
|
||
- name: Run script unit tests | ||
run: ./ci/dev/test-scripts.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
main() { | ||
cd "$(dirname "$0")/../.." | ||
code-asher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
bats ./test/scripts | ||
} | ||
|
||
main "$@" |
Uh oh!
There was an error while loading. Please reload this page.