-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (84 loc) · 3.27 KB
/
Copy pathci.yml
File metadata and controls
101 lines (84 loc) · 3.27 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
name: CI
on:
push:
branches: [main]
pull_request:
# Allow running the (slow) mutation-testing job on demand and nightly.
workflow_dispatch:
schedule:
- cron: '0 3 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
# Skip the fast PR pipeline on the nightly schedule (mutation job runs then).
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Type-check
run: npm run check-types
- name: Lint
run: npm run lint
- name: Build
run: npm run build
# The end-to-end tests (test/integration.node.test.ts) run the REAL
# komet-node — the only way to catch a breaking change in its RPC or trace
# format. Install it the same way the devcontainer does: Nix + RV's binary
# caches + `kup install komet-node` (prebuilt, no from-source kdist build).
- name: Install Nix
env:
NIX_CONFIG: experimental-features = nix-command flakes
run: |
curl -L https://nixos.org/nix/install | sh -s -- --no-daemon --yes
echo "$HOME/.nix-profile/bin:$HOME/.local/bin" >> "$GITHUB_PATH"
# APPEND (not overwrite) RV's binary caches AFTER the installer wrote its
# own /etc/nix/nix.conf — matching .devcontainer/Dockerfile. Writing this
# before the install would let the installer clobber it, and kup would then
# miss the cache and build the K semantics from source (minutes, timeout).
- name: Register RV binary caches
run: |
sudo mkdir -p /etc/nix
printf '%s\n' \
'trusted-users = root runner' \
'extra-substituters = https://k-framework.cachix.org https://k-framework-binary.cachix.org' \
'extra-trusted-public-keys = k-framework.cachix.org-1:jeyMXB2h28gpNRjuVkehg+zLj62ma1RnyyopA/20yFE= k-framework-binary.cachix.org-1:pJedQ8iG19BW3v/DMMmiRVtwRBGO3fyMv2Ws0OpBADs=' \
| sudo tee -a /etc/nix/nix.conf
- name: Install komet-node
run: |
curl -L https://kframework.org/install | bash
kup install komet-node
timeout 60 komet-node --help >/dev/null
- name: Test with coverage gate (includes real komet-node e2e)
run: npm run coverage:ci
mutation:
# Mutation testing multiplies the suite runtime, so it is NOT on the PR
# critical path — run it manually (workflow_dispatch) or nightly (schedule).
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Mutation testing (pure core)
run: npm run mutation
- name: Upload mutation report
if: always()
uses: actions/upload-artifact@v4
with:
name: mutation-report
path: reports/mutation
if-no-files-found: ignore