2021-05-26 05:55:54 -07:00
|
|
|
name: Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
env:
|
2022-06-24 02:20:27 -07:00
|
|
|
BATS_VERSION: v1.7.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-18.04
|
|
|
|
- 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
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Install test dependencies
|
|
|
|
if: runner.os == 'macos'
|
2021-11-18 03:05:27 -07:00
|
|
|
run: brew install coreutils fish elvish
|
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
|
|
|
|
|
|
|
|
# Download elvish binary and add to path
|
2022-04-09 10:07:19 -07:00
|
|
|
curl https://dl.elv.sh/linux-amd64/elvish-v0.18.0.tar.gz -o elvish-v0.18.0.tar.gz
|
|
|
|
tar xzf elvish-v0.18.0.tar.gz
|
|
|
|
rm elvish-v0.18.0.tar.gz
|
2021-11-18 03:05:27 -07:00
|
|
|
mkdir -p "$HOME/bin"
|
2022-04-09 10:07:19 -07:00
|
|
|
mv elvish-v0.18.0 "$HOME/bin/elvish"
|
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: |
|
|
|
|
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 }}
|