-
Notifications
You must be signed in to change notification settings - Fork 22
115 lines (108 loc) · 2.97 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
110
111
112
113
114
115
name: CI
on:
push:
branches:
- master
- staging
- trying
pull_request:
branches:
- master
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
matrix:
rust:
- stable
- nightly
os:
- ubuntu-latest
- macOS-latest
- windows-latest
runs-on: ${{ matrix.os }}
env:
RUSTFLAGS: "--deny warnings"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Build
run: cargo build --all-targets
- name: Build All Features
# defmt 0.3 doesn't build when targeting windows
if: ${{ matrix.os != 'windows-latest' }}
run: cargo build --all-targets --all-features
- name: Run tests
run: cargo test
no-std:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install embedded targets
run: rustup target add thumbv6m-none-eabi thumbv7m-none-eabi
- name: Install flip-link
run: cargo install flip-link
- name: Build bxcan for thumbv6m
run: cargo build --target thumbv6m-none-eabi
- name: Build testsuite for thumbv7m
working-directory: testsuite
run: cargo test --no-run --verbose --no-default-features --target thumbv7m-none-eabi
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Check code formatting
run: cargo fmt -- --check
# I haven't found a good way to host the runner, and don't really have time to fix infra issues
# at the moment, so the HIL suite is currently skipped.
hil:
runs-on: ubuntu-latest
# The secrets are not supplied for 'pull_request' events, so don't run for those.
if: github.event_name == 'push' && false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # everything
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: not needed
- name: Push changes to CI repository
run: |
git checkout -b bxcan-ci-master
git remote add ci [email protected]:jonas-schievink/bxcan-ci.git
git push -u ci -f
sleep 5
- name: Trigger and wait for HIL workflow
uses: jonas-schievink/workflow-proxy@v1
with:
workflow: HIL
ref: bxcan-ci-master
repo: jonas-schievink/bxcan-ci
token: ${{ secrets.PRIVATE_CI_PERSONAL_ACCESS_TOKEN }}
repost-logs: true
ci:
if: ${{ success() }}
# all new jobs must be added to this list
needs: [test, no-std, lint]
runs-on: ubuntu-latest
steps:
- name: CI succeeded
run: exit 0