This repository has been archived by the owner on Dec 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: adopt asdf for internal dev. init WSL test environments (#956)
- Loading branch information
Showing
8 changed files
with
154 additions
and
187 deletions.
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 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` | ||
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 |