-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 1.8 KB
/
ci.yml
File metadata and controls
65 lines (55 loc) · 1.8 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
name: CI
run-name: ${{ github.ref_name }}
on:
pull_request:
branches:
- main
jobs:
make_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
env:
MATRIX_FILE: matrix.jsonc
steps:
- name: Clone repo
uses: actions/checkout@v4
with:
fetch-depth: 1
- id: set-matrix
run: |
echo "matrix=$(grep -v '//' $MATRIX_FILE | jq -c '.')" >> "$GITHUB_OUTPUT"
ci:
name: CI
needs: make_matrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{fromJson(needs.make_matrix.outputs.matrix)}}
max-parallel: 5
steps:
- name: Clone repo
uses: actions/checkout@v4
- name: Extract toolchain channel
id: extract_toolchain
shell: bash
run: |
TOOLCHAIN_CHANNEL=$(grep 'channel' rust-toolchain.toml | cut -d '"' -f 2)
echo "Toolchain channel: $TOOLCHAIN_CHANNEL"
echo "TOOLCHAIN_CHANNEL=$TOOLCHAIN_CHANNEL" >> $GITHUB_OUTPUT
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.extract_toolchain.outputs.TOOLCHAIN_CHANNEL }}
- name: Setup just runner
uses: extractions/setup-just@v2
- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
- name: Build project
run: cargo build --target ${{ matrix.target }}
- name: Test project
# Skip tests on FreeBSD, because testing are not supported by cross on FreeBSD.
# https://github.com/cross-rs/cross#supported-targets
if: ${{ !contains(matrix.target, 'freebsd') && !contains(matrix.target, 'aarch64-pc-windows-msvc') }}
run: cargo test --verbose