Repository navigation
180 lines (147 loc) · 5.26 KB
/
Copy pathci.yml
File metadata and controls
180 lines (147 loc) · 5.26 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: CI
on:
pull_request:
branches: [main, 'release/**']
types: [opened, synchronize, reopened, ready_for_review]
push:
branches: [main, 'release/**']
paths-ignore: ['**/*.md', 'LICENSE', '.gitignore']
permissions:
contents: read
pull-requests: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
lint_unit_tests_and_builds:
needs: changes
if: needs.changes.outputs.renderer == 'true'
runs-on: ubuntu-latest
steps:
# eslint-plugin-diff needs the base branch present to diff against.
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run test:run -w packages/bruno-api-docs
# `draft` is null on push events, so that arm is required.
- name: Build
if: github.event_name == 'push' || github.event.pull_request.draft == false
run: npm run build -w packages/bruno-api-docs
- name: Build standalone
if: github.event_name == 'push' || github.event.pull_request.draft == false
run: npm run build:standalone -w packages/bruno-api-docs
e2e:
needs: [changes, lint_unit_tests_and_builds]
if: needs.changes.outputs.renderer == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/bruno-api-docs
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
working-directory: .
- run: npx playwright install --with-deps chromium
- run: npm run test:e2e
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: packages/bruno-api-docs/playwright-report/
retention-days: 30
changes:
# nothing runs on a draft; marking it ready is a trigger of its own
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubuntu-latest
outputs:
renderer: ${{ steps.renderer.outputs.renderer }}
integrations: ${{ steps.integrations.outputs.integrations }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@0e4a8c6effa4802afeda77dc8d303f8176d7dfad # v3
id: renderer
with:
predicate-quantifier: 'every'
filters: |
renderer:
- '!integrations/**'
- '!examples/integrations/**'
- '!**/*.md'
- '!LICENSE'
- '!.gitignore'
- uses: dorny/paths-filter@0e4a8c6effa4802afeda77dc8d303f8176d7dfad # v3
id: integrations
with:
filters: |
integrations:
- 'integrations/**'
- 'examples/integrations/**'
- '.github/workflows/ci.yml'
- '.github/workflows/integrations-matrix.yml'
integrations:
needs: changes
# a job-level if, not a workflow paths filter: a skipped job still reports and satisfies the required check
if: needs.changes.outputs.integrations == 'true'
runs-on: ubuntu-latest
# checks: write is for the test reporter; job-scoped so the renderer jobs keep least privilege
permissions:
contents: read
checks: write
defaults:
run:
working-directory: integrations
env:
FORCE_COLOR: 1
JUNIT_DIR: results
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
with:
working_directory: integrations
- uses: actions/cache@v4
with:
path: ~/.npm
key: npm-integrations-${{ hashFiles('integrations/package-lock.json') }}
restore-keys: npm-integrations-
- run: npm ci
- name: lint
run: npm run lint
- name: build
run: npm run build
- name: unit
run: bash nodejs/scripts/unit.sh
- name: contract, every framework byte for byte
run: bash nodejs/scripts/check-all.sh
- name: examples
run: bash contract-tests/examples.sh
- name: one matrix cell, from packed tarballs
run: bash nodejs/scripts/matrix.sh --cell express@5 --results results
# every assertion in the Checks tab, failures as annotations
- uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
if: always()
with:
name: integrations
path: integrations/results/**/*.xml
reporter: java-junit
fail-on-error: false
# both tiers depend on the live CDN bundle, which this repo does not control, so neither can
# block a merge. `contract` is ours to fix when red; `renderer` is theirs to know about.
- name: browser
continue-on-error: true
run: npx playwright install --with-deps chromium
- name: browser, our contract
continue-on-error: true
run: npx playwright test --config contract-tests/browser/playwright.config.mjs --project=contract
- name: browser, the renderer
continue-on-error: true
run: npx playwright test --config contract-tests/browser/playwright.config.mjs --project=renderer