From 560ee6b1a0d3d35e2620587daea0967edb05696f Mon Sep 17 00:00:00 2001 From: BSKY Date: Sun, 15 Mar 2020 08:10:48 +0900 Subject: [PATCH] Enable Windows tests on GitHub Actions --- .github/workflows/workflow.yml | 42 ++++++++++++++++++++++------------ appveyor.yml | 18 --------------- 2 files changed, 27 insertions(+), 33 deletions(-) delete mode 100644 appveyor.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 1230d65a0..176373b70 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -3,10 +3,10 @@ name: Main workflow on: push: paths-ignore: - - '**.md' + - "**.md" pull_request: paths-ignore: - - '**.md' + - "**.md" schedule: - cron: "0 0 * * 5" @@ -14,7 +14,7 @@ jobs: test: strategy: matrix: - os: [macOS-latest, ubuntu-latest] + os: [macos-latest, ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} @@ -22,16 +22,16 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Fetch tags - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - name: Fetch all tags + run: git fetch --depth 1 origin +refs/tags/*:refs/tags/* - - name: Install macOS deps - if: matrix.os == 'macOS-latest' + - 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 - - name: Install ubuntu deps + - name: Install dependencies on Ubuntu if: matrix.os == 'ubuntu-latest' run: | PPA="ppa:fish-shell/nightly-master" @@ -39,14 +39,26 @@ jobs: sudo apt-get update sudo apt-get -y install fish - - name: Install bats - run: | - git clone --branch v1.1.0 https://github.com/bats-core/bats-core.git $HOME/bats-core + - name: Install bats-core on Windows + if: matrix.os == 'windows-latest' + run: npm install -g bats@1.1.0 - - name: Run tests + - name: Install bats-core on Unix systems + if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' run: | - export PATH=$HOME/bats-core/bin:$PATH - bats test + 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" + + - name: Run tests on Windows + if: matrix.os == 'windows-latest' + run: bats test + env: + GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + continue-on-error: true + + - name: Run tests on Unix systems + if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' + run: bats test env: GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -64,7 +76,7 @@ jobs: run: bash lint.sh format: - runs-on: macOS-latest + runs-on: macos-latest steps: - name: Checkout code diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 4207491e1..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,18 +0,0 @@ -clone_depth: 50 - -install: - - ps: Install-Product node $env:nodejs_version - - npm cache clear --force - - ps: >- - if ($env:nodejs_version -eq "4") { - npm install npm@latest-5 -g - } else { - npm install npm@latest -g - } - - npm --version - - npm install -g bats - -build: false - -test_script: - - C:\cygwin\bin\bash -lc "export PATH="/usr/bin:/usr/local/bin:/cygdrive/c/Users/appveyor/AppData/Roaming/npm" && cd $APPVEYOR_BUILD_FOLDER && bats test"