-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (80 loc) · 2.85 KB
/
Copy pathci.yml
File metadata and controls
98 lines (80 loc) · 2.85 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
name: CI
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
verify:
name: typecheck, lint, unit, build, e2e
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Typecheck
run: npm run typecheck
- name: Lint
run: npm run lint
- name: Unit and component tests
run: npm test
- name: Production build
run: npm run build
# The end-to-end suite runs against the production build above, in fixture
# mode and with no token, so it never contacts GitHub.
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: End-to-end tests
run: npm run test:e2e:only
- name: Upload the Playwright report on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report
retention-days: 7
privacy-audit:
name: privacy audit
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
# The demo is synthetic; no personal repository may reappear in the tree.
#
# The names are assembled from halves on purpose: written out in full they
# would appear in this file, and the audit would then find itself.
- name: No personal repository references in tracked files
run: |
A='renren-'; A="${A}across-tabs"
B='Data'; B="${B}Data"
C='Drill'; C="${C}Lab"
D='Pet'; D="${D}Note"
if git grep -nIi -e "$A" -e "$B" -e "$C" -e "$D" -- .; then
echo "::error::a removed personal repository name is back in the tree"
exit 1
fi
echo "no personal repository references"
- name: Every github.com/renrenmimi link points at this project
run: |
if git grep -nI 'github.com/renrenmimi/' -- . | grep -v 'github.com/renrenmimi/RepoTimeMachine'; then
echo "::error::a github.com/renrenmimi link points somewhere other than RepoTimeMachine"
exit 1
fi
echo "all renrenmimi links point at RepoTimeMachine"
# Assembled from halves for the same reason as above: spelled out, the
# pattern would appear in this file and the audit would find itself.
- name: The token is never given a public prefix
run: |
P='NEXT_'; P="${P}PUBLIC_GITHUB_TOKEN"
if git grep -nI -e "$P" -- .; then
echo "::error::the token must never be exposed with a public prefix"
exit 1
fi
echo "no public token variable"