2021-05-26 05:55:54 -07:00
|
|
|
name: Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
env:
|
2022-06-25 21:00:12 -07:00
|
|
|
ELVISH_VERSION: v0.18.0
|
2023-01-04 13:42:34 -07:00
|
|
|
NUSHELL_VERSION: 0.73.0
|
2021-05-26 05:55:54 -07:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
nix:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- macos-10.15
|
2022-06-24 02:20:27 -07:00
|
|
|
- macos-11
|
|
|
|
- macos-12
|
2021-05-26 05:55:54 -07:00
|
|
|
- ubuntu-20.04
|
2022-06-24 02:20:27 -07:00
|
|
|
- ubuntu-22.04
|
2021-05-26 05:55:54 -07:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2022-06-24 02:26:43 -07:00
|
|
|
uses: actions/checkout@v3
|
2021-05-26 05:55:54 -07:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Install test dependencies
|
|
|
|
if: runner.os == 'macos'
|
2023-01-04 13:42:34 -07:00
|
|
|
run: brew install coreutils fish elvish nushell
|
2021-05-26 05:55:54 -07:00
|
|
|
|
|
|
|
- name: Install test dependencies
|
|
|
|
if: runner.os == 'linux'
|
|
|
|
run: |
|
2021-11-18 03:05:27 -07:00
|
|
|
sudo add-apt-repository -y ppa:fish-shell/nightly-master
|
2021-05-26 05:55:54 -07:00
|
|
|
sudo apt-get update
|
2021-11-18 03:05:27 -07:00
|
|
|
sudo apt-get -y install fish curl
|
|
|
|
|
2023-01-04 13:42:34 -07:00
|
|
|
# Create $HOME/bin
|
|
|
|
mkdir -p "$HOME/bin"
|
|
|
|
|
2021-11-18 03:05:27 -07:00
|
|
|
# Download elvish binary and add to path
|
2022-06-25 21:00:12 -07:00
|
|
|
curl https://dl.elv.sh/linux-amd64/elvish-${{ env.ELVISH_VERSION }}.tar.gz -o elvish-${{ env.ELVISH_VERSION }}.tar.gz
|
|
|
|
tar xzf elvish-${{ env.ELVISH_VERSION }}.tar.gz
|
|
|
|
rm elvish-${{ env.ELVISH_VERSION }}.tar.gz
|
|
|
|
mv elvish-${{ env.ELVISH_VERSION }} "$HOME/bin/elvish"
|
2023-01-04 13:42:34 -07:00
|
|
|
|
|
|
|
# Download nushell binary and add to path
|
|
|
|
curl -L https://github.com/nushell/nushell/releases/download/${{ env.NUSHELL_VERSION }}/nu-${{ env.NUSHELL_VERSION }}-x86_64-unknown-linux-gnu.tar.gz -o nu-${{ env.NUSHELL_VERSION }}-x86_64-unknown-linux-gnu.tar.gz
|
|
|
|
tar xzf nu-${{ env.NUSHELL_VERSION }}-x86_64-unknown-linux-gnu.tar.gz
|
|
|
|
rm nu-${{ env.NUSHELL_VERSION }}-x86_64-unknown-linux-gnu.tar.gz
|
|
|
|
mv nu-${{ env.NUSHELL_VERSION }}-x86_64-unknown-linux-gnu/* "$HOME/bin"
|
|
|
|
|
|
|
|
# Add $HOME/bin to path
|
2021-11-18 03:05:27 -07:00
|
|
|
echo "$HOME/bin" >>"$GITHUB_PATH"
|
2021-05-26 05:55:54 -07:00
|
|
|
|
|
|
|
- name: Install bats
|
|
|
|
run: |
|
2022-07-12 08:07:59 -07:00
|
|
|
git clone --depth 1 --branch "v$(grep -Eo "^\\s*bats\\s*.*$" ".tool-versions" | cut -d ' ' -f2-)" https://github.com/bats-core/bats-core.git $HOME/bats-core
|
2021-05-26 05:55:54 -07:00
|
|
|
echo "$HOME/bats-core/bin" >>"$GITHUB_PATH"
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: bats test
|
|
|
|
env:
|
|
|
|
GITHUB_API_TOKEN: ${{ github.token }}
|