-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (87 loc) · 3.24 KB
/
rust.yml
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
name: Rust
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
CI_RUST_CACHE_VERSION: v1
permissions:
contents: read
jobs:
build:
strategy:
matrix:
os: [ubuntu-24.04, windows-2022]
rustc_channel: [stable, nightly]
codegen: [default]
include:
# fix stable version across possible matrix
- rustc_channel: stable
# renovate: rustc-stable
rustc_version: '1.82.0'
# fix nightly version across possible matrix
- rustc_channel: nightly
# renovate: rustc-nightly
rustc_version: '2024-06-12'
# try cranelift if we're on nightly and build for Linux machines
- os: ubuntu-24.04
rustc_channel: nightly
# renovate: rustc-nightly
rustc_version: '2024-06-12'
codegen: cranelift
runs-on: ${{ matrix.os }}
steps:
- name: dump context
run: |
echo '${{ toJSON(matrix) }}'
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Install compiler ${{ matrix.rustc_channel }} ( ${{ matrix.rustc_version }} )
run: |
if [[ "${{ matrix.rustc_channel }}" == nightly ]]; then
rustup install nightly-${{ matrix.rustc_version }}
rustup component add clippy --toolchain nightly-${{ matrix.rustc_version }}
rustup override set nightly-${{ matrix.rustc_version }}
else
rustup install ${{ matrix.rustc_version }}
rustup component add clippy --toolchain ${{ matrix.rustc_version }}
rustup override set ${{ matrix.rustc_version }}
fi
shell: bash
- name: Install cranelift if necessary
run: |
rustup component add rustc-codegen-cranelift-preview --toolchain nightly-${{ matrix.rustc_version }}
shell: bash
if: ${{ matrix.codegen == 'cranelift' }}
- name: Setup codegen unstable flag
run: |
printf 'CODEGEN_SELECTION=-Zcodegen-backend=cranelift' >> "$GITHUB_ENV"
if: ${{ matrix.codegen == 'cranelift' }}
- name: Build RUSTFLAGS
run: |
printf 'RUSTFLAGS=${{ env.CODEGEN_SELECTION }}' >> "$GITHUB_ENV"
shell: bash
- name: Rust Cache
uses: Swatinem/[email protected]
with:
prefix-key: ${{ matrix.os }}-${{ matrix.rustc_version }}-${{ env.CI_RUST_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
# See rust-wasm.yml for CI details about those package
- name: Build package
run: cargo build --workspace --exclude origlang-interop --exclude origlang-interop-frontend-webserver --verbose
- name: Lint with clippy
run: cargo clippy --workspace --exclude origlang-interop --exclude origlang-interop-frontend-webserver --verbose
- name: Run tests
run: cargo test --workspace --exclude origlang-interop --exclude origlang-interop-frontend-webserver --verbose
env:
RUST_BACKTRACE: 1
RUST_LOG: debug
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Run compile test
run: cargo run -p origlang-testsuite
env:
RUST_BACKTRACE: 1
RUST_LOG: debug