chore: bump workbox-build to v7 #209
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
env: | |
YARN_ENABLE_SCRIPTS: false # disable post-install scripts | |
jobs: | |
prepare-yarn-cache: | |
name: Prepare Cache | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Use Node.js latest | |
uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
cache: "yarn" | |
- name: Check Yarn dedupe | |
run: | | |
yarn dedupe --check | |
- name: Check or update Yarn cache | |
run: | | |
yarn install --immutable --mode=skip-build | |
test: | |
name: Test on Node.js # GitHub will add ${{ matrix.node-version }} to this title | |
needs: prepare-yarn-cache | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node-version: [latest, 20, 18] | |
os: ["ubuntu-latest", "windows-latest"] | |
hexo-version: [6] | |
include: | |
- node-version: latest | |
os: ubuntu-latest | |
hexo-version: 6 | |
coverage: 'true' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Use Node.js latest # Run yarn on latest node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
cache: "yarn" | |
- name: Install | |
run: | | |
yarn install | |
yarn add --dev hexo@${{ matrix.hexo-version }} | |
- name: Build | |
run: | | |
yarn build | |
- name: Use Node.js ${{ matrix.node-version }} # Checkout node version for test executor | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Test | |
if: ${{ matrix.coverage == '' }} | |
run: | | |
node --test | |
- name: Test with coverage | |
if: ${{ matrix.coverage == 'true' }} | |
run: | | |
node --test --experimental-test-coverage --test-reporter=spec --test-reporter=lcov --test-reporter-destination=stdout --test-reporter-destination=coverage | |
- name: Coveralls GitHub Action | |
if: ${{ matrix.coverage == 'true' }} | |
uses: coverallsapp/github-action@v2 | |
with: | |
file: coverage |