forked from bluesky-social/atproto
-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (140 loc) · 5.31 KB
/
Copy pathrepo.yaml
File metadata and controls
149 lines (140 loc) · 5.31 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
name: Repository CI
on:
pull_request:
concurrency:
group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
cache: pnpm
node-version-file: '.nvmrc'
- run: pnpm install --frozen-lockfile
env:
PUPPETEER_SKIP_DOWNLOAD: true
# lex-cli code generation can be a bottleneck. The "prebuild" script in
# the "api" and "ozone" packages only re-runs lex-cli when needed: if the
# generated output is missing, or if any lexicon JSON has a newer mtime
# than the generated files. We cache the generated output keyed on the
# content of the lexicon JSONs (plus the package.json files that define
# the codegen command), so unchanged lexicons restore from cache.
#
# However, on a cache hit we have to fix mtimes by hand.
# `actions/checkout` writes every checked-out file (including
# lexicons/**/*.json) with mtime = checkout time, while `actions/cache`
# restores files with their original archived mtime (older). Without
# intervention, every lexicon JSON looks "newer" than the restored
# generated files and the prebuild script would re-run lex-cli even though
# nothing has changed. Touching the restored files brings their mtime to
# "now", so the prebuild's `find -newer` check correctly reports no newer
# lexicons.
- uses: actions/cache@v4
id: lex-cli-cache
with:
path: |
packages/api/src/client
packages/ozone/src/lexicon
key: lex-cli-${{ hashFiles('lexicons/**/*.json', 'packages/api/package.json', 'packages/ozone/package.json') }}
- if: steps.lex-cli-cache.outputs.cache-hit == 'true'
run: find packages/api/src/client packages/ozone/src/lexicon -exec touch {} +
- run: pnpm build
- uses: actions/upload-artifact@v4
with:
# Preserve the result of codegen and build steps.
name: dist
retention-days: 2
path: |
packages/*/dist
packages/*/*/dist
packages/*/src/proto
packages/*/src/lexicons
packages/lex/*/src/lexicons
packages/lex/*/tests/lexicons
packages/oauth/*/src/lexicons
packages/oauth/*/src/locales/*/messages.ts
packages/api/src/client
packages/api/src/moderation/const/labels.ts
packages/ozone/src/lexicon
changeset:
name: Changeset
runs-on: ubuntu-latest
# Disabled on the fork: PRs (including upstream syncs) do not carry
# changesets, so upstream's `pnpm changeset status` check would always fail.
if: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for git diff against base branch
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
cache: pnpm
node-version-file: '.nvmrc'
- run: pnpm install --frozen-lockfile
env:
PUPPETEER_SKIP_DOWNLOAD: true
- run: pnpm changeset status --since=origin/${{ github.base_ref }}
test:
name: Test
needs: build
runs-on: ubuntu-22.04
# Puppeteer does not work in recent Ubuntu versions without a workaround due
# to sandboxing issues. Using "ubuntu-latest" results in the following
# error:
#
# No usable sandbox! If you are running on Ubuntu 23.10+ or another Linux
# distro that has disabled unprivileged user namespaces with AppArmor, see
# https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md.
# Otherwise see
# https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md
# for more information on developing with the (older) SUID sandbox. If you
# want to live dangerously and need an immediate workaround, you can try
# using --no-sandbox.
strategy:
fail-fast: false
matrix:
shard: [1/8, 2/8, 3/8, 4/8, 5/8, 6/8, 7/8, 8/8]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
cache: pnpm
node-version-file: '.nvmrc'
- run: echo "CURRENT_MONTH=$(date +'%Y-%m')" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Cache Puppeteer browser binaries
with:
path: ~/.cache/puppeteer
key: ${{ env.CURRENT_MONTH }}-${{ runner.os }}-${{ runner.arch }}
- run: pnpm install --frozen-lockfile
- uses: actions/download-artifact@v4
with:
name: dist
path: packages
- run: pnpm test:withFlags --maxWorkers=1 --shard=${{ matrix.shard }} --passWithNoTests
verify:
name: Verify
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
cache: pnpm
node-version-file: '.nvmrc'
- run: pnpm install --frozen-lockfile
env:
PUPPETEER_SKIP_DOWNLOAD: true
- uses: actions/download-artifact@v4
with:
name: dist
path: packages
- run: pnpm verify