(actions) also test node 18 #756
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: Node CI | |
on: | |
push: | |
pull_request: | |
env: | |
FORCE_COLOR: 1 | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, ubuntu-latest, windows-latest] | |
node: [16, 18] | |
include: | |
- os: windows-latest | |
commandPrefix: '' | |
- os: ubuntu-20.04 | |
commandPrefix: xvfb-run | |
- os: ubuntu-latest | |
commandPrefix: xvfb-run | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Get yarn cache dir | |
if: ${{ runner.os != 'Windows' }} | |
id: yarn-cache | |
shell: bash | |
run: | | |
echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT} | |
- name: Yarn cache | |
if: ${{ runner.os != 'Windows' }} | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ matrix.os }}-yarn-node-${{ matrix.node }}-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
${{ matrix.os }}-yarn-node-${{ matrix.node }}- | |
${{ matrix.os }}-yarn-node- | |
- name: yarn install | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 10 | |
max_attempts: 3 | |
command: yarn install | |
- name: yarn lint | |
run: yarn lint | |
- name: yarn test | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 3 | |
command: ${{ matrix.commandPrefix }} yarn run test:ci | |
- name: Upload coverage to Codecov | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == 16}} | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage/clover.xml |