Repository navigation
95 lines (87 loc) · 3.44 KB
/
Copy pathci.yml
File metadata and controls
95 lines (87 loc) · 3.44 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: CI
on:
push:
branches: [main]
pull_request:
# Nothing here needs to write anything.
permissions:
contents: read
jobs:
test:
name: schema tests (Node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['20', '22', '24']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- run: npm test
# The filter-to-SQL compiler is an exercise rather than a deliverable, but
# its suite is where the §7 requirement that operands be bound and never
# interpolated is actually checked. A test that does not run enforces
# nothing, so it runs here.
- run: npm run test:experiment
# The 0.6.0 bin shipped as a silent no-op because nothing exercised the packed
# artifact. Package managers disagree about how they link a bin — npm and yarn
# symlink, pnpm writes a shim, Berry's PnP has no node_modules at all, and
# Windows gets .cmd wrappers instead of symlinks — and that disagreement is
# exactly what broke. So the artifact is installed and driven under each of
# them, on each platform that links differently.
artifact:
name: packed artifact (${{ matrix.pm }} on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, pm: npm }
- { os: ubuntu-latest, pm: pnpm }
- { os: ubuntu-latest, pm: yarn }
- { os: ubuntu-latest, pm: yarn-pnp }
- { os: ubuntu-latest, pm: bun }
# Windows links a bin as a .cmd wrapper that passes the real path, and
# macOS resolves /tmp through a symlink. Both change what the entry
# guard sees, so both are covered rather than reasoned about.
- { os: windows-latest, pm: npm }
- { os: macos-latest, pm: npm }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install ${{ matrix.pm }}
shell: bash
run: |
set -euo pipefail
case '${{ matrix.pm }}' in
pnpm) npm install -g pnpm@10 ;;
# Berry, installed from npm rather than through corepack so the
# version is pinned and no global opt-in is needed. It takes over
# the `yarn` command, which is what the smoke script calls.
yarn-pnp) npm install -g @yarnpkg/cli-dist@4 ;;
# bun's own binary arrives via its postinstall, so npm can do this
# and the pipeline needs neither curl|bash nor a third-party action.
bun) npm install -g bun ;;
*) ;; # npm and yarn classic are already on the runners
esac
- name: Smoke-test the packed artifact
shell: bash
run: .github/scripts/smoke-packed-artifact.sh '${{ matrix.pm }}'
openapi:
name: OpenAPI examples resolve
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
# Keeps the README's integration snippets honest: they are extracted from
# these files, so if the specs stop resolving the docs are already wrong.
- run: npx --yes @redocly/cli@latest lint examples/openapi-3.1-post-search.yaml
- run: npx --yes @redocly/cli@latest lint examples/openapi-3.2-query-method.yaml