-
Notifications
You must be signed in to change notification settings - Fork 46
191 lines (182 loc) · 6.81 KB
/
Copy pathci.yml
File metadata and controls
191 lines (182 loc) · 6.81 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: CI
on:
pull_request:
workflow_dispatch:
schedule:
# Run daily at 11 AM UTC, after the nightlies are typically published.
- cron: '0 11 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Do not add permissions here! Configure them at the job level!
permissions: {}
jobs:
rust-version:
name: read Rust version
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.read.outputs.version }}
steps:
- uses: actions/checkout@v7
- id: read
run: |
version=$(sed -n 's/^channel = "\(.*\)".*/\1/p' rust-toolchain.toml)
echo "version=$version" >> "$GITHUB_OUTPUT"
validate:
name: validate sources
needs: rust-version
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f # ratchet:mlugg/setup-zig@v2.0.5
with:
version: 0.16.0
- uses: roc-lang/setup-roc@cbe782d6f165b89c87d99f50a59ac4f5f73b4427 # ratchet:roc-lang/setup-roc@v0.3.0
with:
version: nightly-new-compiler
nightly-tag: nightly-2026-10-04-130536d
- name: Install Rust toolchain
run: |
rustup toolchain install "${{ needs.rust-version.outputs.version }}" --profile minimal --target x86_64-unknown-linux-musl --component llvm-tools-preview
rustup default "${{ needs.rust-version.outputs.version }}"
- name: Test release tooling
run: python3 -m unittest scripts/test_check_release_version.py scripts/test_check_version_bump.py scripts/test_update_nix_release.py
- name: Format, check, and test examples
run: ./scripts/test.py --operation validate
- name: Check native resource ownership with glibc and Valgrind
run: |
sudo apt-get update
sudo apt-get install --yes valgrind
python3 scripts/test_resource_lifetimes.py
nix:
name: Nix release consumer (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-26]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
- name: Build and run an application against the pinned release
run: nix flake check --print-build-logs
validate-windows:
name: validate sources (windows)
needs: rust-version
runs-on: windows-2025
steps:
- uses: actions/checkout@v7
- uses: roc-lang/setup-roc@cbe782d6f165b89c87d99f50a59ac4f5f73b4427 # ratchet:roc-lang/setup-roc@v0.3.0
with:
version: nightly-new-compiler
nightly-tag: nightly-2026-10-04-130536d
- name: Install Rust toolchain
shell: bash
run: |
rustup toolchain install "${{ needs.rust-version.outputs.version }}" --profile minimal --target x86_64-pc-windows-msvc
rustup default "${{ needs.rust-version.outputs.version }}"
- name: Format, check, and test examples
shell: bash
run: ./scripts/test.py --operation validate
build-examples:
name: build examples (${{ matrix.target }})
needs: [rust-version, validate]
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- target: x64mac
os: macos-26-intel
rust_target: x86_64-apple-darwin
- target: arm64mac
os: macos-26
rust_target: aarch64-apple-darwin
- target: x64musl
os: ubuntu-24.04
rust_target: x86_64-unknown-linux-musl
- target: arm64musl
os: ubuntu-24.04-arm
rust_target: aarch64-unknown-linux-musl
- target: x64win
os: windows-2025
rust_target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- name: Install Zig
if: runner.os != 'Windows'
uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f # ratchet:mlugg/setup-zig@v2.0.5
with:
version: 0.16.0
- uses: roc-lang/setup-roc@cbe782d6f165b89c87d99f50a59ac4f5f73b4427 # ratchet:roc-lang/setup-roc@v0.3.0
with:
version: nightly-new-compiler
nightly-tag: nightly-2026-10-04-130536d
- name: Install Rust toolchain
shell: bash
run: |
rustup toolchain install "${{ needs.rust-version.outputs.version }}" --profile minimal --target ${{ matrix.rust_target }}
rustup default "${{ needs.rust-version.outputs.version }}"
- name: Install LLVM tools for Linux host stripping
if: endsWith(matrix.target, 'musl')
run: rustup component add llvm-tools-preview
- name: Cross-compile every example
shell: bash
run: ./scripts/test.py --operation build --target "${{ matrix.target }}" --artifact-dir dist/example-binaries
- name: Upload example binaries
uses: actions/upload-artifact@v7
with:
name: basic-cli-example-binaries-${{ matrix.target }}
path: dist/example-binaries/${{ matrix.target }}
if-no-files-found: error
run-examples:
name: run examples (${{ matrix.target }})
needs: [rust-version, build-examples]
strategy:
fail-fast: false
matrix:
include:
- target: x64mac
os: macos-26-intel
valgrind: false
- target: arm64mac
os: macos-26
valgrind: false
- target: x64musl
os: ubuntu-24.04
valgrind: true
- target: arm64musl
os: ubuntu-24.04-arm
valgrind: false
- target: x64win
os: windows-2025
valgrind: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- name: Install Rust toolchain
shell: bash
run: |
rustup toolchain install "${{ needs.rust-version.outputs.version }}" --profile minimal
rustup default "${{ needs.rust-version.outputs.version }}"
- name: Install Valgrind
if: matrix.valgrind
run: |
sudo apt-get update
sudo apt-get install --yes valgrind
- name: Download native example binaries
uses: actions/download-artifact@v8
with:
name: basic-cli-example-binaries-${{ matrix.target }}
path: dist/example-binaries/${{ matrix.target }}
- name: Run native spec cases
if: matrix.valgrind == false
shell: bash
run: ./scripts/test.py --operation run --target "${{ matrix.target }}" --artifact-dir dist/example-binaries
- name: Run native spec cases with Valgrind
if: matrix.valgrind
shell: bash
run: ./scripts/test.py --operation run --target "${{ matrix.target }}" --artifact-dir dist/example-binaries --valgrind