Repository navigation
72 lines (66 loc) · 2.42 KB
/
Copy pathruntime-boundary.yml
File metadata and controls
72 lines (66 loc) · 2.42 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
# Runtime boundary ratchet for the Deno -> Node migration.
# Counts `Deno.` occurrences and direct std-library imports per scope
# (src, src-js, resources, package/src, tests). Two modes:
# - pull_request: compares the merge commit with its first parent (the base
# branch tip). A Deno.* API that src/deno_ral replaces is an error the
# contributor fixes; any other increase above the PR's own baseline is a
# warning that keeps the job red (within that baseline: a notice). The contributor
# has nothing to change: a maintainer pushes the baseline update to the PR
# before merging (job summary), so a green PR never turns main red.
# - push (main) and workflow_dispatch: fails when a count rises above
# tools/runtime-boundary-baseline.json.
# See dev-docs/runtime-migration/02-runtime-boundary-check.md.
name: Runtime Boundary
on:
workflow_dispatch:
pull_request:
branches: [main]
paths:
- "src/**"
- "package/src/**"
- "tests/**"
- "tools/check-runtime-boundary.ts"
- "tools/runtime-boundary-baseline.json"
- "tools/codemod-deno-ral.ts"
- "tools/codemod/**"
- ".github/workflows/runtime-boundary.yml"
push:
branches: [main]
paths:
- "src/**"
- "package/src/**"
- "tests/**"
- "tools/check-runtime-boundary.ts"
- "tools/runtime-boundary-baseline.json"
- "tools/codemod-deno-ral.ts"
- "tools/codemod/**"
- ".github/workflows/runtime-boundary.yml"
permissions:
contents: read
jobs:
runtime-boundary:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Set Path
shell: bash
run: |
echo "$HOME/bin" >> $GITHUB_PATH
- name: Configure Quarto
uses: ./.github/workflows/actions/quarto-dev
- name: Codemod contract test (tools/codemod)
run: package/dist/bin/tools/x86_64/deno test --allow-all --import-map=src/import_map.json tools/codemod/
- name: Check runtime boundary
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
run: |
if [ "$EVENT_NAME" = "pull_request" ]; then
# The checkout is the merge commit: HEAD^1 is the base branch tip.
quarto run --dev tools/check-runtime-boundary.ts --against HEAD^1
else
quarto run --dev tools/check-runtime-boundary.ts
fi