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