Repository navigation
111 lines (97 loc) · 4.09 KB
/
Copy pathpr.yaml
File metadata and controls
111 lines (97 loc) · 4.09 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
name: pr
# Pull-request gate for the Deel CLI. dev is the release line (the release pipeline builds
# from dev HEAD), so everything that lands here must already be verified.
#
# The repo is going public, so this workflow is written to stay safe with fork PRs:
# - `pull_request` only — never `pull_request_target` (fork code must not run with write tokens);
# - public actions only, pinned to a commit SHA — no private internal reusable workflows;
on:
pull_request:
types: [opened, edited, synchronize, reopened, labeled, unlabeled]
push:
branches: [dev]
workflow_dispatch:
permissions:
contents: read
pull-requests: read
concurrency:
group: pr-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
validate-pr:
name: validate-pr
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 2
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version-file: .nvmrc
- name: Collect changed files
run: git diff --name-only HEAD^1 HEAD > "$RUNNER_TEMP/pr-files.txt"
# Title/body/labels are passed through the environment, never interpolated into the script:
# a PR body is attacker-controlled text on a public repo.
- name: Validate PR requirements
env:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_BODY: ${{ github.event.pull_request.body }}
PR_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
PR_IS_FORK: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
PR_BASE: ${{ github.event.pull_request.base.ref }}
run: node scripts/check-pr.ts --files "$RUNNER_TEMP/pr-files.txt"
check:
name: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version-file: .nvmrc
- name: Install
run: npm ci
# Same steps as `npm run check`, split so a failure names itself in the job summary.
- name: Typecheck
run: npm run typecheck
- name: Tests + coverage gate
run: npm run test:coverage
- name: Manifest ↔ command map consistency
run: npm run check:manifest
- name: Public API command map
run: npm run check:command-map
- name: Lockfile carries every bun platform binary
run: npm run check:lockfile
- name: package.json ↔ src/version.ts
run: npm run check:version
- name: Shell scripts (installer, build, hooks)
run: npm run check:shell
build-smoke:
name: build-smoke
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version-file: .nvmrc
- name: Install
run: npm ci
# The compiled binary is what users actually run; `node --test` never exercises the bun
# --compile --bytecode path, so build the host target and make sure it starts.
- name: Compile host binary
run: npm run build
- name: Binary reports the package version and renders help
run: |
expected="deel $(node -p "require('./package.json').version")"
actual="$(./dist/deel --version)"
if [ "$actual" != "$expected" ]; then
echo "::error::dist/deel --version printed '$actual', expected '$expected'"
exit 1
fi
./dist/deel --help > /dev/null
./dist/deel adjustments create --help > /dev/null
./dist/deel jobs list --help > /dev/null
echo "dist/deel: $actual, help renders, $(du -h dist/deel | cut -f1)"
- name: Cross-compile and sign the macOS binaries
run: bash scripts/build-all.sh --only darwin