Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
ci: adopt asdf for internal dev. init WSL test environments (#956)
Browse files Browse the repository at this point in the history
  • Loading branch information
jthegedus authored May 26, 2021
1 parent 3237167 commit 5b49e0c
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 187 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/lint.yml
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 .
95 changes: 95 additions & 0 deletions .github/workflows/tests.yml
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 }}
88 changes: 0 additions & 88 deletions .github/workflows/workflow.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .tool-versions
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# asdf [![Main workflow](https://github.com/asdf-vm/asdf/workflows/Main%20workflow/badge.svg)](https://github.com/asdf-vm/asdf/actions)
# asdf [![Lint](https://github.com/asdf-vm/asdf/actions/workflows/lint.yml/badge.svg)](https://github.com/asdf-vm/asdf/actions/workflows/lint.yml) [![Tests](https://github.com/asdf-vm/asdf/actions/workflows/tests.yml/badge.svg)](https://github.com/asdf-vm/asdf/actions/workflows/tests.yml)

**Manage multiple runtime versions with a single CLI tool, extendable via plugins** - [docs at asdf-vm.com](https://asdf-vm.github.io/asdf/)

Expand Down
71 changes: 0 additions & 71 deletions Vagrantfile

This file was deleted.

8 changes: 0 additions & 8 deletions lint.sh

This file was deleted.

29 changes: 10 additions & 19 deletions release/README.md
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

0 comments on commit 5b49e0c

Please sign in to comment.