Skip to content

Commit 0b6c808

Browse files
committed
Add CI
1 parent 1d5e131 commit 0b6c808

1 file changed

Lines changed: 111 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Build
7+
8+
#env:
9+
# RUSTFLAGS: '--deny warnings' # clippy generates warnings at the moment
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
env:
15+
RUSTFLAGS: '--deny warnings'
16+
strategy:
17+
matrix:
18+
rust: [stable]
19+
TARGET:
20+
- x86_64-unknown-linux-gnu
21+
- x86_64-unknown-linux-musl
22+
- arm-unknown-linux-gnueabi # Raspberry Pi 1
23+
- armv7-unknown-linux-gnueabihf # Raspberry Pi 2, 3, etc
24+
# Bare metal
25+
- thumbv6m-none-eabi
26+
- thumbv7em-none-eabi
27+
- thumbv7em-none-eabihf
28+
- thumbv7m-none-eabi
29+
30+
steps:
31+
- uses: actions/checkout@v2
32+
- uses: actions-rs/toolchain@v1
33+
with:
34+
profile: minimal
35+
toolchain: ${{ matrix.rust }}
36+
target: ${{ matrix.TARGET }}
37+
override: true
38+
- uses: actions-rs/cargo@v1
39+
with:
40+
use-cross: true
41+
command: build
42+
args: --target=${{ matrix.TARGET }}
43+
44+
test:
45+
name: Tests
46+
env:
47+
RUSTFLAGS: '--deny warnings'
48+
runs-on: ubuntu-latest
49+
strategy:
50+
matrix:
51+
rust: [stable, beta]
52+
TARGET: [x86_64-unknown-linux-gnu]
53+
54+
steps:
55+
- uses: actions/checkout@v2
56+
- uses: actions-rs/toolchain@v1
57+
with:
58+
profile: minimal
59+
toolchain: ${{ matrix.rust }}
60+
target: ${{ matrix.TARGET }}
61+
override: true
62+
63+
- name: Test
64+
uses: actions-rs/cargo@v1
65+
with:
66+
use-cross: true
67+
command: test
68+
args: --target=${{ matrix.TARGET }}
69+
70+
docs:
71+
runs-on: ubuntu-latest
72+
steps:
73+
- uses: actions/checkout@v2
74+
- uses: actions-rs/toolchain@v1
75+
with:
76+
profile: minimal
77+
toolchain: stable
78+
override: true
79+
components: rustfmt
80+
- uses: actions-rs/cargo@v1
81+
with:
82+
command: doc
83+
84+
fmt:
85+
runs-on: ubuntu-latest
86+
steps:
87+
- uses: actions/checkout@v2
88+
- uses: actions-rs/toolchain@v1
89+
with:
90+
profile: minimal
91+
toolchain: stable
92+
override: true
93+
components: rustfmt
94+
- uses: actions-rs/cargo@v1
95+
with:
96+
command: fmt
97+
args: --all -- --check
98+
99+
clippy:
100+
runs-on: ubuntu-latest
101+
steps:
102+
- uses: actions/checkout@v2
103+
- uses: actions-rs/toolchain@v1
104+
with:
105+
profile: minimal
106+
toolchain: 1.64.0 # clippy is too much of a moving target at the moment
107+
override: true
108+
components: clippy
109+
- uses: actions-rs/clippy-check@v1
110+
with:
111+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)