-
Notifications
You must be signed in to change notification settings - Fork 16
109 lines (102 loc) · 3.18 KB
/
ci.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
name: Continuous Integration
on:
push:
branches:
- main
- github-actions
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt,clippy
- name: rustfmt
run: cargo fmt --all -- --check
- name: clippy
run: cargo clippy --all-features --all-targets -- -D warnings
test:
name: Test
runs-on: ${{ matrix.job.os }}
strategy:
matrix:
job:
- { os: ubuntu-22.04, target: x86_64-unknown-linux-gnu }
- { os: ubuntu-22.04, target: x86_64-unknown-linux-musl }
- { os: windows-2022, target: x86_64-pc-windows-msvc }
- { os: macos-13, target: x86_64-apple-darwin }
- { os: macos-14, target: aarch64-apple-darwin }
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.job.target }}
- name: Fetch
run: cargo fetch --target ${{ matrix.job.target }}
- name: Build
run: cargo test --target ${{ matrix.job.target }} --no-run
- name: Test
run: cargo test --target ${{ matrix.job.target }}
install-cross:
runs-on: ubuntu-latest
steps:
- uses: XAMPPRocky/get-github-release@v1
id: cross
with:
owner: rust-embedded
repo: cross
matches: linux-musl
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: cross-linux-musl
path: ${{ steps.cross.outputs.install_path }}
# This job builds and tests non-tier1 targets
build_lower_tier:
name: Build sources
runs-on: ubuntu-22.04
needs: install-cross
strategy:
matrix:
job:
- target: i686-unknown-linux-gnu
- target: aarch64-unknown-linux-gnu
- target: aarch64-unknown-linux-musl
- target: arm-unknown-linux-gnueabi
- target: arm-unknown-linux-musleabi
- target: arm-linux-androideabi
- target: arm-unknown-linux-gnueabihf
steps:
- uses: actions/checkout@v4
- name: Download Cross
uses: actions/download-artifact@v4
with:
name: cross-linux-musl
path: /tmp/
- run: chmod +x /tmp/cross
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.job.target }}
- name: Build and Test
run: |
/tmp/cross build --target ${{ matrix.job.target }} --all-targets
# /tmp/cross test --target ${{ matrix.job.target }}
# /tmp/cross test --target ${{ matrix.job.target }} -- ignored
deny-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: deny check
uses: EmbarkStudios/cargo-deny-action@v1
with:
# Note that advisories are checked separately on a schedule in audit.yml
command: check bans licenses sources