Repository navigation
106 lines (92 loc) · 3.66 KB
/
Copy pathci.yml
File metadata and controls
106 lines (92 loc) · 3.66 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
name: Validate catalog
# No path filters: the build reads catalog/, stacks/, docs/, site/ and the
# top-level Markdown files, and the whole run takes seconds.
#
# Runs on pull requests, and as the first job of pages.yml on every push to
# main (so a push builds only here: in this job, node-minimum and windows). With `upload-dist` the
# checkout has full history (the sitemap's lastmod dates come from git) and
# the built site is uploaded as the Pages artifact for pages.yml to deploy.
on:
pull_request:
workflow_call:
inputs:
upload-dist:
description: Build with full git history and upload site/dist as the Pages artifact
type: boolean
default: false
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: ${{ inputs.upload-dist && '0' || '1' }}
- name: Setup Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
# check-added needs history to follow renames; a pull request checkout is shallow.
- name: Fetch full history
run: |
if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
git fetch --unshallow --no-tags origin
fi
# The one check sequence (package.json "check"): lint, tests, validate,
# check-added, build. A step added there runs here with no YAML change.
- name: Lint, test, validate, check added dates, build
run: npm run check
# Pull requests only: a table of every changed licence field, old and
# new, beside the entry's newest Evidence line, on the run's summary page.
- name: Summarise licence-field changes
if: github.event_name == 'pull_request'
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
git fetch --no-tags --depth=1 origin "$BASE_SHA"
node site/pr-diff.mjs --base "$BASE_SHA" --out "$GITHUB_STEP_SUMMARY"
- name: Upload Pages artifact
if: ${{ inputs.upload-dist }}
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: site/dist
# package.json engines and CONTRIBUTING promise Node 22; .nvmrc (above) is
# newer. Run the same checks on 22 so that promise stays true.
node-minimum:
name: validate (Node 22)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- name: Setup Node 22
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 22
- name: Lint, test, validate, check added dates, build
run: npm run check
# Contributors run the scripts on Windows too (path separators, CRLF
# checkouts, case-insensitive files), so the same checks run there (#267).
windows:
name: validate (Windows)
runs-on: windows-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
- name: Lint, test, validate, check added dates, build
run: npm run check