Repository navigation
62 lines (58 loc) · 2.2 KB
/
Copy pathtest_host_protocol_stable.yaml
File metadata and controls
62 lines (58 loc) · 2.2 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
name: Host protocol stability
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
paths:
- "packages/host-protocol/**"
- "protocols/host/check-stable.sh"
- "pnpm-lock.yaml"
- ".github/workflows/test_host_protocol_stable.yaml"
permissions:
contents: read
concurrency:
group: host-protocol-stable-${{ github.ref }}
cancel-in-progress: true
jobs:
stable:
name: Stable protocol is unchanged
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version-file: .node-version
- name: Install the host protocol package
run: pnpm install --filter @marimo-team/host-protocol --prod --frozen-lockfile --ignore-scripts
- name: Compare the stable protocol with the base branch
env:
BASE: ${{ github.event.pull_request.base.sha }}
ALLOWED: ${{ contains(github.event.pull_request.labels.*.name, 'stable-protocol-change') }}
run: |
status=0
protocols/host/check-stable.sh "$BASE" > changes.diff || status=$?
if [ "$status" -eq 0 ]; then
cat changes.diff
exit 0
fi
if [ "$status" -ne 1 ]; then
cat changes.diff
echo "::error::The stable host protocol could not be compared with the base branch."
exit 1
fi
{
echo "### The stable host protocol changed"
echo
echo '```diff'
cat changes.diff
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
if [ "$ALLOWED" = "true" ]; then
echo "::notice::The stable host protocol changed, and the stable-protocol-change label allows it."
exit 0
fi
echo "::error::The stable host protocol changed. Put the change behind an experimental feature, or add the stable-protocol-change label to allow it. The job summary shows the difference."
exit 1