-
Notifications
You must be signed in to change notification settings - Fork 6
53 lines (48 loc) · 1.94 KB
/
Copy pathci.yml
File metadata and controls
53 lines (48 loc) · 1.94 KB
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
50
51
52
53
name: CI
on:
push:
branches: [master]
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
checks:
# Install, lint, format and typecheck are the shared workflow's; node comes
# from .nvmrc and pnpm from the `packageManager` field.
#
# `@v1` is the moving major tag, so a fix in the shared workflow lands here
# on the next run. Never `@main`: an unreviewed merge there would rerun
# every consumer's CI.
uses: GSTJ/magic/.github/workflows/ci.yml@v1
with:
build-command: pnpm run build
test-command: pnpm run test
# `build/` is generated, so the only way to know the published tarball
# isn't empty is to pack one. changelog:check renders a synthetic history
# of every commit type through the real changelog preset and fails if a
# type renders against policy or a breaking change goes missing.
#
# One `extra-command`, so they're chained. `&&` short-circuits, which is
# what we want: either failing fails the job.
extra-command: npm pack --dry-run && pnpm run changelog:check
# Nothing here uses turbo.
turbo-cache: false
# master's ruleset requires a status check literally named "Lint, test and
# build", and a called workflow reports as "<caller job> / <called job>", so
# it can never produce that context. This job carries the name instead. It is
# deletable the day the ruleset is pointed at the shared workflow's check —
# a repository settings change, which is not this PR's to make.
#
# `if: always()` matters: a job skipped because its dependency failed reports
# as skipped, and a skipped required check counts as passed.
validate:
name: Lint, test and build
needs: checks
if: always()
runs-on: ubuntu-latest
steps:
- name: Fail unless the shared workflow passed
run: '[ "${{ needs.checks.result }}" = "success" ]'