-
-
Notifications
You must be signed in to change notification settings - Fork 11
151 lines (142 loc) · 5.5 KB
/
build.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
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
name: HAL
on: [push, pull_request]
env:
RUSTDOCFLAGS: -D warnings
RUSTFLAGS: -D warnings
MSRV: 1.70.0
jobs:
setup:
if: github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- id: pacs
run: echo "::set-output name=pac_matrix::$(grep -o '^sam\w*' hal/Cargo.toml | uniq | jq -ncR '[inputs]')"
- id: boards
run: echo "::set-output name=board_matrix::$(ls ./boards --indicator-style=none | jq -ncR '[inputs]')"
- id: features
run: echo "::set-output name=feature_matrix::[\"reconfigurable-system-pins\",\"usart-spi-host-without-select\",\"rt\",\"critical-section\"]"
outputs:
pac_matrix: ${{ steps.pacs.outputs.pac_matrix }}
board_matrix: ${{ steps.boards.outputs.board_matrix }}
feature_matrix: ${{ steps.features.outputs.feature_matrix }}
build:
if: github.event.pull_request.head.repo.full_name != github.repository
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
pac: ${{ fromJson(needs.setup.outputs.pac_matrix) }}
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Specify toolchain
run: rustup override set $MSRV
- name: Install Rust (thumbv7em)
run: rustup target add thumbv7em-none-eabihf
- name: Build HAL for ${{ matrix.pac }}
run: cargo check --package atsamx7x-hal --features ${{ matrix.pac }},unproven,rt,critical-section
build-latest:
if: github.event.pull_request.head.repo.full_name != github.repository
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
pac: ${{ fromJson(needs.setup.outputs.pac_matrix) }}
continue-on-error: true # we let this fail and carry on, but GH UI is poor not showing amber like other CIs
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Update toolchain
run: rustup update
- name: Specify toolchain
run: rustup override set stable
- name: Install Rust (thumbv7em)
run: rustup target add thumbv7em-none-eabihf
- name: Build HAL for ${{ matrix.pac }}
run: cargo check --package atsamx7x-hal --features ${{ matrix.pac }},unproven,rt,critical-section
build-features:
if: github.event.pull_request.head.repo.full_name != github.repository
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
features: ${{ fromJson(needs.setup.outputs.feature_matrix) }}
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Specify toolchain
run: rustup override set $MSRV
- name: Install Rust (thumbv7em)
run: rustup target add thumbv7em-none-eabihf
- name: Build HAL for ${{ matrix.features }}
run: cargo check --package atsamx7x-hal --features ${{ matrix.features }},samv71q21b,unproven
board-examples:
if: github.event.pull_request.head.repo.full_name != github.repository
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
board: ${{ fromJson(needs.setup.outputs.board_matrix) }}
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Specify toolchain
run: rustup override set $MSRV
- name: Install Rust (thumbv7em)
run: rustup target add thumbv7em-none-eabihf
- name: Build boards/${{ matrix.board }}/examples/*
run: |
cd boards/${{ matrix.board }}
cargo check --examples
clippy-hal:
if: github.event.pull_request.head.repo.full_name != github.repository
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Specify toolchain
run: rustup override set $MSRV
- name: Install Rust (thumbv7em)
run: rustup target add thumbv7em-none-eabihf
- name: Install Clippy
run: rustup component add clippy
- name: Lint HAL
run: cargo clippy --package atsamx7x-hal --no-deps --features samv71q21b,unproven,reconfigurable-system-pins,rt -- --deny warnings
clippy-examples:
if: github.event.pull_request.head.repo.full_name != github.repository
needs: [setup, build, board-examples]
runs-on: ubuntu-latest
strategy:
matrix:
board: ${{ fromJson(needs.setup.outputs.board_matrix) }}
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Specify toolchain
run: rustup override set $MSRV
- name: Install Rust (thumbv7em)
run: rustup target add thumbv7em-none-eabihf
- name: Install Clippy
run: rustup component add clippy
- name: Lint boards/${{ matrix.board }}/examples/*
run: |
cd boards/${{ matrix.board }}
cargo clippy --examples --no-deps -- --deny warnings
docs:
if: github.event.pull_request.head.repo.full_name != github.repository
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Specify toolchain
run: rustup override set $MSRV
- name: Install Rust (thumbv7em)
run: rustup target add thumbv7em-none-eabihf
- name: Build HAL documentation
run: cargo doc --package atsamx7x-hal --no-deps --features samv71q21b,unproven,reconfigurable-system-pins,rt,critical-section
- name: Build HAL doc tests
run: cargo test --package atsamx7x-hal --doc --features samv71q21b,unproven,rt,critical-section --target x86_64-unknown-linux-gnu