mirror of
https://github.com/farcasterxyz/hub-monorepo.git
synced 2026-04-18 03:00:22 -04:00
55 lines
1.3 KiB
YAML
55 lines
1.3 KiB
YAML
name: CI
|
|
on:
|
|
# CI is run on main because new branches can only access caches from master, not previous branches.
|
|
# So building on master allows new PR's to get the cache from before.
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
# prevent multiple simultaneous test runs
|
|
concurrency:
|
|
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build_and_test:
|
|
timeout-minutes: 10
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
shard: [1/2, 2/2]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '18'
|
|
|
|
- name: Restore cached dependencies for Node modules.
|
|
id: module-cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ${{ github.workspace }}/node_modules
|
|
key: ${{ runner.os }}--node--${{ hashFiles('**/yarn.lock') }}
|
|
|
|
- name: Install dependencies
|
|
run: yarn install
|
|
|
|
- name: Run audit
|
|
run: yarn audit
|
|
|
|
- name: Run linter
|
|
run: yarn lint
|
|
|
|
- name: Run build
|
|
run: yarn build
|
|
|
|
- name: Run tests
|
|
run: yarn test:ci --shard=${{ matrix.shard }}
|
|
|
|
- name: Upload coverage results
|
|
uses: codecov/codecov-action@v3
|