Marc Cataford
ec2e46e04d
* build: run tests using actual build * build: build script that includes hashbang prepending * ci: missing /bin/zsh
143 lines
3.5 KiB
YAML
143 lines
3.5 KiB
YAML
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
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- run: git fetch
|
|
- run: . ./script/lint-commits
|
|
|
|
dependencies:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [16, 18]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- uses: actions/cache@v3
|
|
id: dependencies-cache
|
|
env:
|
|
cache-name: dependencies-cache
|
|
with:
|
|
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
|
|
|
|
integration:
|
|
runs-on: ubuntu-latest
|
|
needs: dependencies
|
|
name: Integration tests
|
|
env:
|
|
SHELL: /usr/bin/bash
|
|
strategy:
|
|
matrix:
|
|
node-version: [16, 18]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- uses: actions/cache@v3
|
|
id: dependencies-cache
|
|
env:
|
|
cache-name: dependencies-cache
|
|
with:
|
|
path: .yarn
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}-node-${{ matrix.node-version }}
|
|
- run: |
|
|
corepack enable && yarn
|
|
yarn test:integration
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
needs: dependencies
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18
|
|
- uses: actions/cache@v3
|
|
id: dependencies-cache
|
|
env:
|
|
cache-name: dependencies-cache
|
|
with:
|
|
path: .yarn
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}-node-18
|
|
- run: |
|
|
corepack enable && yarn
|
|
yarn lint
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
needs: dependencies
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [16, 18]
|
|
|
|
env:
|
|
SHELL: /usr/bin/bash
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- uses: actions/cache@v3
|
|
id: dependencies-cache
|
|
env:
|
|
cache-name: dependencies-cache
|
|
with:
|
|
path: .yarn
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}-node-${{ matrix.node-version }}
|
|
- run: |
|
|
corepack enable && yarn
|
|
yarn test --workers=2 --ts
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
needs: dependencies
|
|
env:
|
|
SHELL: /usr/bin/bash
|
|
strategy:
|
|
matrix:
|
|
node-version: [16, 18]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- uses: actions/cache@v3
|
|
id: dependencies-cache
|
|
env:
|
|
cache-name: dependencies-cache
|
|
with:
|
|
path: .yarn
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}-node-${{ matrix.node-version }}
|
|
- run: |
|
|
corepack enable && yarn
|
|
yarn build
|