-
Notifications
You must be signed in to change notification settings - Fork 69
131 lines (108 loc) · 4.1 KB
/
minimal-tests-core.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
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
name: Minimal tests - mmtk-core
on:
pull_request:
branches:
- master
merge_group:
branches:
- master
concurrency:
# Cancels pending runs when a PR gets updated.
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# Setup dynamic test matrix
setup-test-matrix:
runs-on: ubuntu-latest
outputs:
rust: ${{ steps.rust.outputs.array }}
steps:
- uses: actions/checkout@v4
# Get rust version
- id: rust
run: |
export MSRV=`cargo read-manifest | python -c 'import json,sys; print(json.load(sys.stdin)["rust_version"])'`
export TEST=`cat rust-toolchain`
echo "array=[\"$MSRV\", \"$TEST\", \"stable\"]" >> $GITHUB_OUTPUT
minimal-tests-core:
needs: setup-test-matrix
strategy:
fail-fast: false
matrix:
target:
- { os: ubuntu-22.04, triple: x86_64-unknown-linux-gnu }
- { os: ubuntu-22.04, triple: i686-unknown-linux-gnu }
- { os: macos-15, triple: x86_64-apple-darwin }
rust: ${{ fromJson(needs.setup-test-matrix.outputs.rust )}}
name: minimal-tests-core/${{ matrix.target.triple }}/${{ matrix.rust }}
runs-on: ${{ matrix.target.os }}
env:
# This determines the default target which cargo-build, cargo-test, etc. use.
CARGO_BUILD_TARGET: "${{ matrix.target.triple }}"
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: |
# "rustup toolchain install" should always install the host toolchain,
# so we don't specify the triple.
rustup toolchain install ${{ matrix.rust }}
rustup override set ${{ matrix.rust }}
# Ensure we install the target support for the target we are testing for.
# This is especially important for i686-unknown-linux-gnu
# because it's different from the host.
rustup target add ${{ matrix.target.triple }}
rustup component add rustfmt clippy
# Show the Rust toolchain and target we are actually using
- run: rustup show
- run: cargo --version
- run: cargo rustc -- --print cfg
# Setup Environments
- name: Setup Environments
run: ./.github/scripts/ci-setup-${{ matrix.target.triple }}.sh
# Build
- name: Build
run: ./.github/scripts/ci-build.sh
# Test
- name: Test
run: ./.github/scripts/ci-test.sh
style-check:
needs: setup-test-matrix
strategy:
fail-fast: false
matrix:
target:
- { os: ubuntu-22.04, triple: x86_64-unknown-linux-gnu }
- { os: ubuntu-22.04, triple: i686-unknown-linux-gnu }
- { os: macos-12, triple: x86_64-apple-darwin }
rust: ${{ fromJson(needs.setup-test-matrix.outputs.rust )}}
name: style-check/${{ matrix.target.triple }}/${{ matrix.rust }}
runs-on: ${{ matrix.target.os }}
env:
# This determines the default target which cargo-build, cargo-test, etc. use.
CARGO_BUILD_TARGET: "${{ matrix.target.triple }}"
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: |
# "rustup toolchain install" should always install the host toolchain,
# so we don't specify the triple.
rustup toolchain install ${{ matrix.rust }}
rustup override set ${{ matrix.rust }}
# Ensure we install the target support for the target we are testing for.
# This is especially important for i686-unknown-linux-gnu
# because it's different from the host.
rustup target add ${{ matrix.target.triple }}
rustup component add rustfmt clippy
# Show the Rust toolchain and target we are actually using
- run: rustup show
- run: cargo --version
- run: cargo rustc -- --print cfg
# Setup Environments
- name: Setup Environments
run: ./.github/scripts/ci-setup-${{ matrix.target.triple }}.sh
# Style checks
- name: Style checks
run: ./.github/scripts/ci-style.sh
# Document check
- name: Rustdoc
run: ./.github/scripts/ci-doc.sh