v2 #170
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: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
# Allows to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
ci: | |
name: CI on Node ${{ matrix.node-version }} and ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node-version: ['18.x'] | |
os: [ubuntu-latest] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Install Node ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
# See: https://github.com/actions/cache/blob/main/examples.md#node---yarn | |
- name: Get Yarn cache directory | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Use Yarn cache | |
uses: actions/cache@v2 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ matrix.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
# `--prefer-offline` gives local cache the priority to restore | |
run: yarn install --prefer-offline --frozen-lockfile | |
- name: Lint | |
run: yarn lint | |
- name: Test with coverage | |
run: yarn test:cov | |
- name: Build | |
run: yarn build |