Skip to content

Commit d49a9ff

Browse files
authored
Enable GitHub Linux/Arm runners in CI (#3841)
GitHub made Linux Arm 64-bit runners available: https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/. Run regression tests on those and build release packages. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
1 parent f080721 commit d49a9ff

File tree

5 files changed

+68
-34
lines changed

5 files changed

+68
-34
lines changed

.github/actions/build-bundle/action.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Copyright Kani Contributors
22
# SPDX-License-Identifier: Apache-2.0 OR MIT
33
name: Build bundle
4-
description: "Build the Kani bundle for the current architecture and OS. The inputs must match the worker architecture."
4+
description: "Build the Kani bundle for the current platform. The inputs must match the worker architecture."
55
inputs:
6-
arch:
7-
description: "Current architecture tuple"
8-
os:
9-
description: "Current operating system"
6+
platform:
7+
description: "Current platform tuple"
108
outputs:
119
version:
1210
description: "The bundle version (latest or =crate_version)"
@@ -55,14 +53,14 @@ runs:
5553
shell: bash
5654
run: |
5755
cargo bundle -- ${{ env.VERSION }}
58-
echo "BUNDLE=kani-${{ env.VERSION }}-${{ inputs.arch }}.tar.gz" >> $GITHUB_ENV
56+
echo "BUNDLE=kani-${{ env.VERSION }}-${{ inputs.platform }}.tar.gz" >> $GITHUB_ENV
5957
6058
- name: Build package
6159
shell: bash
6260
run: |
6361
cargo package -p kani-verifier
64-
mv target/package/kani-verifier-${{ env.CRATE_VERSION }}.crate ${{ inputs.os }}-kani-verifier.crate
65-
echo "PKG=${{ inputs.os }}-kani-verifier.crate" >> $GITHUB_ENV
62+
mv target/package/kani-verifier-${{ env.CRATE_VERSION }}.crate ${{ inputs.platform }}-kani-verifier.crate
63+
echo "PKG=${{ inputs.platform }}-kani-verifier.crate" >> $GITHUB_ENV
6664
6765
- name: Upload bundle
6866
uses: actions/upload-artifact@v4

.github/workflows/kani.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ${{ matrix.os }}
1919
strategy:
2020
matrix:
21-
os: [macos-13, ubuntu-22.04, ubuntu-24.04, macos-14]
21+
os: [macos-13, ubuntu-22.04, ubuntu-24.04, macos-14, ubuntu-24.04-arm]
2222
steps:
2323
- name: Checkout Kani
2424
uses: actions/checkout@v4

.github/workflows/release.yml

Lines changed: 59 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ env:
2020
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
2121

2222
jobs:
23-
build_bundle_macos:
24-
name: BuildBundle-MacOs
23+
build_bundle_macos_x86_64:
24+
name: BuildBundle-MacOs-x86_64
2525
runs-on: macos-13
2626
outputs:
2727
version: ${{ steps.bundle.outputs.version }}
@@ -41,11 +41,10 @@ jobs:
4141
id: bundle
4242
uses: ./.github/actions/build-bundle
4343
with:
44-
os: macos-13
45-
arch: x86_64-apple-darwin
44+
platform: x86_64-apple-darwin
4645

4746
build_bundle_macos_aarch64:
48-
name: BuildBundle-MacOs-ARM
47+
name: BuildBundle-MacOs-aarch64
4948
runs-on: macos-14
5049
outputs:
5150
version: ${{ steps.bundle.outputs.version }}
@@ -65,11 +64,10 @@ jobs:
6564
id: bundle
6665
uses: ./.github/actions/build-bundle
6766
with:
68-
os: macos-14
69-
arch: aarch64-apple-darwin
67+
platform: aarch64-apple-darwin
7068

71-
build_bundle_linux:
72-
name: BuildBundle-Linux
69+
build_bundle_linux_x86_64:
70+
name: BuildBundle-Linux-x86_64
7371
runs-on: ubuntu-22.04
7472
outputs:
7573
version: ${{ steps.bundle.outputs.version }}
@@ -89,25 +87,53 @@ jobs:
8987
id: bundle
9088
uses: ./.github/actions/build-bundle
9189
with:
92-
os: linux
93-
arch: x86_64-unknown-linux-gnu
90+
platform: x86_64-unknown-linux-gnu
91+
92+
build_bundle_linux_aarch64:
93+
name: BuildBundle-Linux-aarch64
94+
runs-on: ubuntu-24.04-arm
95+
outputs:
96+
version: ${{ steps.bundle.outputs.version }}
97+
bundle: ${{ steps.bundle.outputs.bundle }}
98+
package: ${{ steps.bundle.outputs.package }}
99+
crate_version: ${{ steps.bundle.outputs.crate_version }}
100+
steps:
101+
- name: Checkout code
102+
uses: actions/checkout@v4
103+
104+
- name: Setup Kani Dependencies
105+
uses: ./.github/actions/setup
106+
with:
107+
os: ubuntu-24.04-arm
108+
109+
- name: Build bundle
110+
id: bundle
111+
uses: ./.github/actions/build-bundle
112+
with:
113+
platform: aarch64-unknown-linux-gnu
94114

95115
test-use-local-toolchain:
96116
name: TestLocalToolchain
97-
needs: [build_bundle_macos, build_bundle_linux]
117+
needs: [build_bundle_macos_x86_64, build_bundle_macos_aarch64, build_bundle_linux, build_bundle_linux_arm]
98118
strategy:
99119
matrix:
100-
os: [macos-13, ubuntu-22.04, ubuntu-24.04]
120+
os: [macos-13, macos-14, ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm]
101121
include:
102122
- os: macos-13
103123
rust_target: x86_64-apple-darwin
104-
prev_job: ${{ needs.build_bundle_macos.outputs }}
124+
prev_job: ${{ needs.build_bundle_macos_x86_64.outputs }}
125+
- os: macos-14
126+
rust_target: aarch64-apple-darwin
127+
prev_job: ${{ needs.build_bundle_macos_aarch64.outputs }}
105128
- os: ubuntu-22.04
106129
rust_target: x86_64-unknown-linux-gnu
107-
prev_job: ${{ needs.build_bundle_linux.outputs }}
130+
prev_job: ${{ needs.build_bundle_linux_x86_64.outputs }}
108131
- os: ubuntu-24.04
109132
rust_target: x86_64-unknown-linux-gnu
110-
prev_job: ${{ needs.build_bundle_linux.outputs }}
133+
prev_job: ${{ needs.build_bundle_linux_x86_64.outputs }}
134+
- os: ubuntu-24.04-arm
135+
rust_target: aarch64-unknown-linux-gnu
136+
prev_job: ${{ needs.build_bundle_linux_aarch64.outputs }}
111137
runs-on: ${{ matrix.os }}
112138
steps:
113139
- name: Download bundle
@@ -194,15 +220,19 @@ jobs:
194220
195221
test_bundle:
196222
name: TestBundle
197-
needs: [build_bundle_macos, build_bundle_linux]
223+
needs: [build_bundle_macos_x86_64, build_bundle_macos_aarch64, build_bundle_linux_x86_64, build_bundle_linux_aarch64]
198224
strategy:
199225
matrix:
200-
os: [macos-13, ubuntu-22.04, ubuntu-24.04]
226+
os: [macos-13, macos-14, ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm]
201227
include:
202228
# Stores the output of the previous job conditional to the OS
203-
- prev_job: ${{ needs.build_bundle_linux.outputs }}
229+
- prev_job: ${{ needs.build_bundle_linux_x86_64.outputs }}
204230
- os: macos-13
205-
prev_job: ${{ needs.build_bundle_macos.outputs }}
231+
prev_job: ${{ needs.build_bundle_macos_x86_64.outputs }}
232+
- os: macos-14
233+
prev_job: ${{ needs.build_bundle_macos_aarch64.outputs }}
234+
- os: ubuntu-24.04-arm
235+
prev_job: ${{ needs.build_bundle_linux_aarch64.outputs }}
206236
runs-on: ${{ matrix.os }}
207237
steps:
208238
- name: Download bundle
@@ -242,7 +272,7 @@ jobs:
242272
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/kani-') }}
243273
name: Release
244274
runs-on: ubuntu-24.04
245-
needs: [build_bundle_macos, build_bundle_macos_aarch64, build_bundle_linux, test_bundle]
275+
needs: [build_bundle_macos_x86_64, build_bundle_macos_aarch64, build_bundle_linux_x86_64, build_bundle_linux_aarch64, test_bundle]
246276
outputs:
247277
version: ${{ steps.versioning.outputs.version }}
248278
upload_url: ${{ steps.create_release.outputs.upload_url }}
@@ -270,7 +300,7 @@ jobs:
270300
- name: Download MacOS bundle
271301
uses: actions/download-artifact@v4
272302
with:
273-
name: ${{ needs.build_bundle_macos.outputs.bundle }}
303+
name: ${{ needs.build_bundle_macos_x86_64.outputs.bundle }}
274304

275305
- name: Download MacOS ARM bundle
276306
uses: actions/download-artifact@v4
@@ -280,7 +310,12 @@ jobs:
280310
- name: Download Linux bundle
281311
uses: actions/download-artifact@v4
282312
with:
283-
name: ${{ needs.build_bundle_linux.outputs.bundle }}
313+
name: ${{ needs.build_bundle_linux_x86_64.outputs.bundle }}
314+
315+
- name: Download Linux Arm bundle
316+
uses: actions/download-artifact@v4
317+
with:
318+
name: ${{ needs.build_bundle_linux_aarch64.outputs.bundle }}
284319

285320
- name: Create release
286321
id: create_release
@@ -290,7 +325,7 @@ jobs:
290325
with:
291326
name: kani-${{ env.TAG_VERSION }}
292327
tag: kani-${{ env.TAG_VERSION }}
293-
artifacts: "${{ needs.build_bundle_linux.outputs.bundle }},${{ needs.build_bundle_macos.outputs.bundle }},${{ needs.build_bundle_macos_aarch64.outputs.bundle }}"
328+
artifacts: "${{ needs.build_bundle_linux_x86_64.outputs.bundle }},${{ needs.build_bundle_linux_aarch64.outputs.bundle }},${{ needs.build_bundle_macos_x86_64.outputs.bundle }},${{ needs.build_bundle_macos_aarch64.outputs.bundle }}"
294329
body: |
295330
Kani Rust verifier release bundle version ${{ env.TAG_VERSION }}.
296331
draft: true

scripts/setup/ubuntu-24.04-arm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ubuntu

scripts/setup/ubuntu/install_deps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ sudo apt-get --yes update
3131

3232
sudo DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes "${DEPS[@]}"
3333

34-
ARCH=$(uname -m)
34+
ARCH=$(uname -m | sed 's/aarch64/arm64/')
3535
curl -L --remote-name https://github.com/cvc5/cvc5/releases/download/cvc5-1.3.0/cvc5-Linux-${ARCH}-static.zip
3636
sudo unzip -o -j -d /usr/local/bin cvc5-Linux-${ARCH}-static.zip cvc5-Linux-${ARCH}-static/bin/cvc5
3737
rm cvc5-Linux-${ARCH}-static.zip

0 commit comments

Comments
 (0)