-
Notifications
You must be signed in to change notification settings - Fork 10
49 lines (45 loc) · 1.34 KB
/
node-ci-push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Node CI (landed on protected branch)
on:
push:
branches:
- main
- changeset-release/*
- feature/*
# Our jobs run like this to minimize wasting resource cycles:
# 1. Prime caches for primary configuration (ubuntu on node 14).
# This way the next two jobs can run in parallel but rely on this primed
# cache.
# 2. Lint
# 3. Test (with coverage)
# 4. Chromatic autoApprove on squash commits
#
# For pushes directly to a branch, we assume a PR has been used with wider
# checks, this just makes sure our coverage data is up-to-date.
jobs:
prime_cache_primary:
name: Prime node_modules cache for primary configuration
env:
CI: true
runs-on: ${{ matrix.os }}
strategy:
# Use a matrix as it means we get the version info in the job name
# which is very helpful.
matrix:
os: [ubuntu-latest]
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Install & cache node_modules
uses: Khan/actions@shared-node-cache-v2
with:
node-version: ${{ matrix.node-version }}
lint:
name: Lint
needs: prime_cache_primary
uses: ./.github/workflows/node-ci-lint.yml
test:
name: Test
needs: prime_cache_primary
uses: ./.github/workflows/node-ci-test.yml
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}