-
Notifications
You must be signed in to change notification settings - Fork 762
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
ci: adopt asdf for internal dev. init WSL test environments #956
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
919d109
chore: version dev tools
jthegedus fd842ad
ci: extract linting to own worflow
jthegedus b13588b
ci: used asdf in tests. use wsl on windows runner
jthegedus b640d2f
ci: merge macos ubuntu test job into nix job
jthegedus b5e7b7c
ci: wsl distros
jthegedus 108f200
chore: remove unused Vagrantfile
jthegedus 89847d4
fix: workflow badge links
jthegedus e5c8567
test: older bats version
jthegedus fcf6982
fix: WSL action does not support WSLv1 on OS windows-2016
jthegedus d77372b
ci: do not use asdf in tests
jthegedus 1593a1a
fix: workflow format
jthegedus bf4ed38
ci: try expression syntax for wsl-bash interpolation
jthegedus dda7f50
test: use expression for GITHUB_PATH in WSL
jthegedus 6724197
test: use expression for GITHUB_PATH in WSL
jthegedus 2a23db9
test: original append to github path
jthegedus 8f884d8
ci: only run on Ubuntu WSL
jthegedus 2138182
ci: install bats on WSL using install script
jthegedus f1120db
ci: wsl direct exec of bats, no path appending
jthegedus 5f25b59
ci: unix line endings when performing checkout
jthegedus 9e9c3f7
ci: perform asdf checkout in wsl
jthegedus 2f46b19
fix: workflow default env vars
jthegedus 07fb690
ci: test github workflow default env vars
jthegedus 04be768
ci: github env vars in wsl workflow
jthegedus 9dd3efe
ci: github env vars in wsl workflow
jthegedus 5e1c969
ci: rename lint jobs
jthegedus 17e6dbe
ci: github env vars in wsl workflow
jthegedus 8fb8c23
fix: typo
jthegedus 1563979
ci: try default env format again
jthegedus b684c4d
ci: try without run step sequence
jthegedus b33559a
ci: use github workspace instead of default env vars
jthegedus b9499c8
ci: fix wsl shell cmd
jthegedus c60842a
ci: fix wsl shell cmd
jthegedus 7a56d0c
ci: fix typo
jthegedus 29eaae2
ci: clone asdf to specific empty dir
jthegedus 1aa1840
ci: do not fail on wsl1
jthegedus 0896fe4
chore: rename lint workflow step
jthegedus d3270fb
ci: wsl bats exec location in default dir
jthegedus 7645f69
ci: wsl green check when tests fail
jthegedus bcbd1a2
ci: rm workflow execution filter
jthegedus b47d586
ci: remove continue-on-error for wsl1 job
jthegedus File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
shellcheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install asdf dependencies | ||
uses: asdf-vm/actions/install@v1 | ||
|
||
- name: Run ShellCheck | ||
run: | | ||
shellcheck -s bash -x \ | ||
asdf.sh \ | ||
release/tag.sh \ | ||
bin/asdf \ | ||
bin/private/asdf-exec \ | ||
lib/utils.bash \ | ||
lib/commands/*.bash \ | ||
completions/*.bash \ | ||
test/test_helpers.bash \ | ||
test/fixtures/dummy_plugin/bin/* | ||
|
||
shellfmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install asdf dependencies | ||
uses: asdf-vm/actions/install@v1 | ||
|
||
- name: List file to shfmt | ||
run: shfmt -f . | ||
|
||
- name: Run shfmt | ||
run: shfmt -d . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
env: | ||
BATS_VERSION: v1.3.0 | ||
|
||
jobs: | ||
wsl1: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- windows-2019 | ||
distribution: | ||
- Ubuntu-20.04 | ||
- Ubuntu-18.04 | ||
# - Alpine | ||
# - Debian | ||
# - kali-linux | ||
# - openSUSE-Leap-15.2 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Set git to use LF | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup WSL & install test dependencies | ||
uses: Vampire/setup-wsl@v1 | ||
with: | ||
distribution: ${{ matrix.distribution }} | ||
additional-packages: curl git fish | ||
|
||
- name: Install bats | ||
shell: wsl-bash {0} | ||
run: | | ||
git clone --depth 1 --branch "${{ env.BATS_VERSION }}" https://github.com/bats-core/bats-core.git $HOME/bats-core | ||
cd $HOME/bats-core | ||
./install.sh $HOME | ||
$HOME/bin/bats --version | ||
|
||
- name: Run tests | ||
shell: wsl-bash {0} | ||
run: | | ||
$HOME/bin/bats test | ||
env: | ||
GITHUB_API_TOKEN: ${{ github.token }} | ||
|
||
nix: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- macos-10.15 | ||
# - macos-11 - enable once out of private preview: https://github.com/actions/virtual-environments#available-environments | ||
- ubuntu-18.04 | ||
- ubuntu-20.04 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install test dependencies | ||
if: runner.os == 'macos' | ||
run: brew install coreutils fish | ||
|
||
- name: Install test dependencies | ||
if: runner.os == 'linux' | ||
run: | | ||
PPA="ppa:fish-shell/nightly-master" | ||
sudo add-apt-repository -y "$PPA" | ||
sudo apt-get update | ||
sudo apt-get -y install fish | ||
|
||
- name: Install bats | ||
run: | | ||
git clone --depth 1 --branch "${{ env.BATS_VERSION }}" https://github.com/bats-core/bats-core.git $HOME/bats-core | ||
echo "$HOME/bats-core/bin" >>"$GITHUB_PATH" | ||
|
||
- name: Run tests | ||
run: bats test | ||
env: | ||
GITHUB_API_TOKEN: ${{ github.token }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bats v1.3.0 | ||
shellcheck 0.7.2 | ||
shfmt 3.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,19 @@ | ||
# Release README | ||
|
||
If you are a user you can ignore everything in this directory. This directory | ||
contains documentation and scripts for preparing and tagging new versions of | ||
asdf and is only used by asdf maintainers. | ||
If you are a user you can ignore everything in this directory. This directory contains documentation and scripts for preparing and tagging new versions of asdf and is only used by asdf maintainers. | ||
|
||
## Tagging Release Candidates | ||
|
||
To tag release candidates | ||
1. Update the CHANGELOG. Make sure it contains an entry for the version you are | ||
tagging as well as a dev version things that come after the tag (e.g. a heading | ||
with the format `<next-version>-dev`). | ||
2. Run the tests and the linter - `bats test` and `lint.sh`. | ||
3. Run the release script. The new version must be in the format `0.0.0-rc0`. | ||
For example: `release/tag.sh 0.0.0-rc0`. | ||
4. If the release script succeeds, push to GitHub. Make sure to use the correct | ||
remote to push to the official repository | ||
|
||
1. Update the CHANGELOG. Make sure it contains an entry for the version you are tagging as well as a dev version things that come after the tag (e.g. a heading with the format `<next-version>-dev`) | ||
2. Run the tests and the linter - `bats test` | ||
jthegedus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
3. Run the release script. The new version must be in the format `0.0.0-rc0`. For example: `release/tag.sh 0.0.0-rc0` | ||
4. If the release script succeeds, push to GitHub. Make sure to use the correct remote to push to the official repository | ||
|
||
## Tagging Releases | ||
|
||
1. Update the CHANGELOG. Make sure it contains an entry for the version you are | ||
tagging as well as a dev version things that come after the tag (e.g. a heading | ||
with the format `<next-version>-dev`). | ||
2. Run the tests and the linter - `bats test` and `lint.sh`. | ||
3. Run the release script. The new version must be in the format `0.0.0`. For | ||
example: `release/tag.sh 0.0.0`. | ||
4. If the release script succeeds, push to GitHub. Make sure to use the correct | ||
remote to push to the official repository | ||
1. Update the CHANGELOG. Make sure it contains an entry for the version you are tagging as well as a dev version things that come after the tag (e.g. a heading with the format `<next-version>-dev`) | ||
2. Run the tests and the linter - `bats test` | ||
3. Run the release script. The new version must be in the format `0.0.0`. For example: `release/tag.sh 0.0.0` | ||
4. If the release script succeeds, push to GitHub. Make sure to use the correct remote to push to the official repository |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this job named
nix
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the job that runs our Bats tests on the *nix OSs.
*
is invalid in the job name when I tried naming it*nix
. Didn't think the job name was particularly important.The other job is called
WSL1
because though it is a Windows OS, the environment we want to test in is different distros on WSL1 environment.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can rename the job to whatever, I just thought this was the most descriptive at the time.