-
Notifications
You must be signed in to change notification settings - Fork 711
60 lines (51 loc) · 1.58 KB
/
rust-target.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
name: rust-target
on:
push:
branches:
- main
pull_request:
branches:
- main
merge_group:
branches:
- main
jobs:
define-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.define-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- name: Define Matrix
id: define-matrix
run: |
matrix=$(python ci/set_versions.py)
echo "matrix=$matrix" >> $GITHUB_OUTPUT
test:
runs-on: ubuntu-latest
needs: [define-matrix]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust-version}}
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install libtinfo5 ripgrep
- name: Check headers
run: |
TARGET_VERSIONS=$(echo '${{matrix.target-versions}}' | jq ".[]" | tr -d '"')
for TARGET_VERSION in $TARGET_VERSIONS; do
echo "Running checks for target version $TARGET_VERSION"
HEADERS=$(rg -l '\-\-rust-target[\s=]$TARGET_VERSION' bindgen-tests/tests/headers/ | cut -d '/' -f 4 | cut -d '.' -f 1)
for HEADER in $HEADERS; do
FILE="bindgen-tests/tests/expectations/tests/$HEADER.rs"
echo "Checking $FILE"
rustup run ${{matrix.rust-version}} rustc --edition=2018 --crate-type=rlib --emit=metadata $FILE
done
done