Fix .github/workflows/workflow.yml

Signed-off-by: Sora Morimoto <sora@morimoto.io>
This commit is contained in:
Sora Morimoto 2020-12-03 07:59:08 +09:00
parent 8b4f19c8af
commit 59ad7a62ca

View File

@ -8,59 +8,55 @@ on:
paths-ignore:
- "**.md"
schedule:
- cron: "0 0 * * 5"
- cron: 0 0 * * 5
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
os:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fetch all tags
run: git fetch --depth 1 origin +refs/tags/*:refs/tags/*
with:
fetch-depth: 0
- name: Install dependencies on macOS
if: matrix.os == 'macos-latest'
run: |
brew install coreutils # needed by bats-core
brew install fish # for testing asdf.fish
if: runner.os == 'macOS'
run: brew install coreutils fish
- name: Install dependencies on Ubuntu
if: matrix.os == 'ubuntu-latest'
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-core on Windows
if: matrix.os == 'windows-latest'
run: npm install -g bats@1.1.0
- name: Install bats-core on Unix systems
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
- name: Install bats-core
run: |
git clone --depth 1 --branch v1.1.0 https://github.com/bats-core/bats-core.git $HOME/bats-core
echo "::add-path::$HOME/bats-core/bin"
git clone --depth 1 --branch v1.2.1 https://github.com/bats-core/bats-core.git $HOME/bats-core
echo "$HOME/bats-core/bin" >>"$GITHUB_PATH"
- name: Run tests on Windows
if: matrix.os == 'windows-latest'
if: runner.os == 'Windows'
continue-on-error: true
run: bats test
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
GITHUB_API_TOKEN: ${{ github.token }}
- name: Run tests on Unix systems
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
if: runner.os != 'Windows'
run: bats test
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_API_TOKEN: ${{ github.token }}
lint:
runs-on: ubuntu-latest