-
Notifications
You must be signed in to change notification settings - Fork 4
155 lines (144 loc) · 4.21 KB
/
Copy pathbuild.yml
File metadata and controls
155 lines (144 loc) · 4.21 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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# Adapted from <https://github.com/rtic-rs/cortex-m-rtic/blob/b71df58f2fb4ed85d4c8cf806d5837ce63c73f31/.github/workflows/build.yml>
name: Build
on:
pull_request:
push:
branches:
- master
- ci
env:
CARGO_TERM_COLOR: always
jobs:
# Run cargo fmt -- --check
style:
name: style
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v1
with:
submodules: recursive
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: check workspace formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- run: cd ./examples
- name: check examples formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
test:
name: test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Install libusb, libudev # for hidapi in probe-rs
run: |
sudo apt update
sudo apt install -y libusb-1.0-0-dev libudev-dev
- run: cd cargo-rtic-scope
- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --all
clippy:
name: clippy
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Install libusb, libudev # for hidapi in probe-rs
run: |
sudo apt update
sudo apt install -y libusb-1.0-0-dev libudev-dev
- run: rustup component add clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
build:
name: build
runs-on: ubuntu-20.04
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
toolchain:
- stable
steps:
- name: Checkout
uses: actions/checkout@v1
with:
submodules: recursive
- name: Install libusb, libudev # for hidapi in probe-rs
run: |
sudo apt update
sudo apt install -y libusb-1.0-0-dev libudev-dev
- name: Cache cargo dependencies
uses: actions/cache@v2
with:
path: |
- ~/.cargo/bin/
- ~/.cargo/registry/index/
- ~/.cargo/registry/cache/
- ~/.cargo/git/db/
key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }}
${{ runner.OS }}-cargo-
- name: Cache build output dependencies
uses: actions/cache@v2
with:
path: target
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
${{ runner.OS }}-build-
- name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }})
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
override: true
- name: build workspace
uses: actions-rs/cargo@v1
with:
command: build
args: --target=${{ matrix.target }}
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: cargo-rtic-scope
path: target/${{ matrix.target }}/debug/cargo-rtic-scope
resolve:
name: test_output.sh
runs-on: ubuntu-20.04
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v1
with:
submodules: recursive
- name: download artifact
uses: actions/download-artifact@v2
with:
name: cargo-rtic-scope
path: ./artifacts
- run: chmod +x artifacts/cargo-rtic-scope
- run: rustup target add thumbv7em-none-eabihf
- run: sudo apt update && sudo apt install -y binutils-arm-none-eabi
- run: cargo install rtic-scope-frontend-dummy --path ./rtic-scope-frontend-dummy
- run: .ci/test_outputs.sh artifacts/cargo-rtic-scope