Repository navigation
135 lines (128 loc) · 5.67 KB
/
Copy pathvalidate.yml
File metadata and controls
135 lines (128 loc) · 5.67 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
name: validate
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
# The release refuses to republish changed artifact bytes under a version it
# has already published. That rule used to be reachable only from the release,
# which runs on main after the merge -- so a pull request that broke it merged
# green and took the channel down afterwards. Nothing about asking the
# question needs the signing key, so it is asked here instead.
channel-preflight:
name: signed channel accepts this tree
runs-on: ubuntu-latest
env:
FTW_DRIVER_KEY_ID: ftw-drivers-2026-01
FTW_DRIVER_SIGNING_PUBLIC_KEY: MX+j27UBkyM099hTyJlmMLK9qlTTDUJsaK/vH12fFKc=
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
python-version: "3.12"
- run: uv sync --frozen --extra package --extra dev
# A public release asset and a public key: a fork's pull request can read
# both, and neither is a secret this workflow could leak.
- name: Download the published channel manifest
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
published="${RUNNER_TEMP}/ftw-driver-published"
mkdir -p "${published}"
if ! gh release view drivers-beta --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
echo "drivers-beta has never been published; no versions to collide with."
exit 0
fi
gh release download drivers-beta --repo "${GITHUB_REPOSITORY}" \
--pattern manifest.json --dir "${published}" --clobber
echo "FTW_DRIVER_PUBLISHED_MANIFEST=${published}/manifest.json" >> "${GITHUB_ENV}"
- name: Would the signed channel publish this tree?
if: env.FTW_DRIVER_PUBLISHED_MANIFEST != ''
run: >-
uv run --no-sync python tools/ftw_repository.py check-versions
--previous-manifest "${FTW_DRIVER_PUBLISHED_MANIFEST}"
--key-id "${FTW_DRIVER_KEY_ID}"
public-boundary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
python-version: "3.12"
- run: uv sync --frozen --extra package --extra dev
- run: uv run --no-sync python tools/check_public_boundary.py
drivers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
python-version: "3.12"
- run: uv sync --frozen --extra package --extra dev
- run: bash tools/build_luac.sh --with-interpreter ./luac55
- run: |
for file in drivers/lua/*.lua; do
./luac55 -p "$file"
done
- run: bash tools/check_sandbox.sh
- run: uv run --no-sync python tools/validate_manifest.py
- run: uv run --no-sync python tools/generate_index.py
- run: git diff --exit-code -- index.yaml
- run: uv run --no-sync python tools/generate_devices.py
- run: git diff --exit-code -- devices.yaml
- run: uv run --no-sync python tools/generate_support_status.py
- run: git diff --exit-code -- support-status.json SUPPORT_STATUS.md
- run: uv run --no-sync pytest -q drivers/tests tests
# The sign-off certifies authored content, so this asks it of the commits that
# carry some, and skips merge commits.
#
# A pull request that falls behind main has to be brought up to date before it
# can merge, and the merge commit GitHub's "Update branch" button writes has no
# Signed-off-by trailer. Counting it made a stale pull request unmergeable
# until someone force-pushed a trailer onto a commit they did not write, which
# nobody can do on a fork this repository cannot push to. That deadlocked #65
# and, before it, a0d5d73 on the same branch.
#
# The trade-off is that a conflict resolved inside a merge commit is content
# this check no longer sees. That is the same line the upstream DCO app draws,
# and the reviewable content still arrives on the authored commits either side.
dco:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
fetch-depth: 0
- name: Require Developer Certificate of Origin sign-off
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
missing=0
while IFS= read -r commit; do
if ! git show -s --format=%B "$commit" | grep -qi '^Signed-off-by: .\+ <.\+>$'; then
echo "Missing Signed-off-by: $commit" >&2
missing=1
fi
done < <(git rev-list --no-merges "$BASE_SHA..$HEAD_SHA")
if [ "$missing" -ne 0 ]; then
echo "Sign off with 'git commit -s', or add the trailer to the commits above" >&2
echo "with 'git rebase --signoff $BASE_SHA' and force-push." >&2
fi
exit "$missing"
history-secret-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
python-version: "3.12"
- run: git log --all --format=fuller -p | uv run --frozen python tools/check_history_secrets.py