name: CI
on:
pull_request:
push:
branches: [main]
jobs:
adr-0001-depcheck:
name: No-dependencies check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: . ./script/check-deps
commit-lint:
name: Commit message hygiene
with:
fetch-depth: 0
- run: git fetch
- run: . ./script/lint-commits
dependencies:
strategy:
matrix:
node-version: [16, 18]
- uses: actions/setup-node@v3
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v3
id: dependencies-cache
env:
cache-name: dependencies-cache
path: .yarn
key: ${{ runner.os }}-build-${{env.cache-name}}-${{ hashFiles('**/yarn.lock') }}-node-${{ matrix.node-version }}
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
run: corepack enable && yarn
lint:
needs: dependencies
node-version: 18
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}-node-18
- run: |
corepack enable && yarn
yarn lint
test:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}-node-${{ matrix.node-version }}
yarn test --workers=2 --ts
build:
yarn build