-
Notifications
You must be signed in to change notification settings - Fork 20
80 lines (68 loc) · 2.07 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
on:
pull_request:
branches: [main]
push:
branches: [main]
tags: ["v*"]
name: ci
jobs:
build:
name: hygiene
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Install dependencies
run: sudo apt-get install -y libtss2-dev
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- name: Check formatting
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy --all-features -- -Dclippy::all -D warnings
package:
name: package
runs-on: ubuntu-latest
strategy:
matrix:
target:
- aarch64-unknown-linux-gnu
- arm-unknown-linux-gnueabihf
- armv5te-unknown-linux-musleabi
- armv7-unknown-linux-gnueabihf
- armv7-unknown-linux-musleabihf
- mips-unknown-linux-musl
- mipsel-unknown-linux-musl
- x86_64-unknown-debian-gnu
- x86_64-tpm-debian-gnu
steps:
- uses: actions/checkout@v3
- uses: davidB/rust-cargo-make@v1
- uses: dtolnay/rust-toolchain@stable
- name: install cross
uses: jaxxstorm/action-install-gh-release@v1.9.0
env:
## Allow cross install into PATH
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repo: rust-embedded/cross
- name: build target
run: cargo make --profile ${{ matrix.target }} build
- name: package release
if: startsWith(github.ref, 'refs/tags')
run: cargo make --profile ${{ matrix.target }} pkg
- name: push release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fail_on_unmatched_files: true
files: |
gateway-mfr-*.tar.gz
gateway-mfr-*.checksum