-
Notifications
You must be signed in to change notification settings - Fork 4
94 lines (85 loc) · 2.72 KB
/
ci.yml
File metadata and controls
94 lines (85 loc) · 2.72 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
name: CI
on:
push:
branches:
- master
pull_request:
env:
# The CACHE_VERSION environment variable can be updated to force the use of a
# new cache if the current cache contents become corrupted/invalid. This can
# sometimes happen when (for example) the OS version is changed but older .so
# files are cached, which can have various unintended effects.
CACHE_VERSION: 1
RUST_TOOLCHAIN: "nightly-2025-09-14"
jobs:
lint:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v4
- name: Deps
run: |
rustup default ${{ env.RUST_TOOLCHAIN }}
rustup component add clippy rustc-dev
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
prefix-key: "${{ env.CACHE_VERSION }}-${{ matrix.os }}"
# TODO (#80): Fix lints, use --deny warnings
- name: Lint
run: cargo clippy --locked
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-15]
steps:
- uses: actions/checkout@v4
- name: Deps
run: |
rustup default ${{ env.RUST_TOOLCHAIN }}
rustup component add rustc-dev rust-src
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
prefix-key: "${{ env.CACHE_VERSION }}-${{ matrix.os }}"
- run: cargo test --locked
- name: Install mir-json binaries
run: cargo install --locked
- name: Translate modified Rust standard libraries
run: mir-json-translate-libs
- name: Install jq on Ubuntu
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y jq
- name: Run regression tests
env:
CRUX_RUST_LIBRARY_PATH: ${{ github.workspace }}/rlibs
run: ./tests/run-all.sh
- name: Validate schema
env:
VER: 1.1
OS_TAG: ${{ matrix.os }}
ARCH_TAG: ${{ runner.arch }}
run: .github/ci.sh validate_json_schema
# NB: These binary distributions will not work unless you have the
# appropriate Rust toolchain installed beforehand.
- name: Extract executables to binary distribution
shell: bash
run: .github/ci.sh setup_dist_bins
- name: Compress binary distribution
shell: bash
run: |
NAME="mir-json-${{ matrix.os }}-${{ runner.arch }}"
echo "NAME=$NAME" >> $GITHUB_ENV
.github/ci.sh zip_dist $NAME
- name: Upload binary distribution
uses: actions/upload-artifact@v4
if: github.event.pull_request.head.repo.fork == false && github.repository_owner == 'GaloisInc'
with:
name: ${{ env.NAME }}
path: "${{ env.NAME }}.tar.gz*"
if-no-files-found: error