Skip to content

Commit 5d83a0f

Browse files
committed
meta: add CI configuration
This commit adds a CI (and the Dockerfile it is based upon) that: 1. builds the HAL for the atsame70n21b and atsamv71q21b targets; 2. builds the board examples; 3. checks the formatting of all code except pac/; and 4. lints the code base with clippy, expect pac/. Closes atsams-rs#21.
1 parent 4a6b237 commit 5d83a0f

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

.ci/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM rust:1.61.0-slim
2+
3+
RUN apt-get update && apt-get install -y \
4+
binutils-arm-none-eabi \
5+
git \
6+
&& rm -rf /var/lib/apt/lists/*
7+
8+
RUN rustup target add thumbv7em-none-eabihf && \
9+
rustup component add rustfmt && \
10+
rustup component add clippy

.ci/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This directory contains the `Dockerfile` used in the CI of the HAL. See [GitLab Container Registry documentation](https://git.grepit.se/embedded-rust/atsamx7x-hal/container_registry) for update instructions.

.gitlab-ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
image: "registry.git.grepit.se/embedded-rust/atsamx7x-hal"
2+
3+
stages:
4+
- HAL
5+
- examples
6+
- lint
7+
8+
default:
9+
before_script:
10+
- rustup show
11+
12+
samv71q21b:
13+
stage: HAL
14+
script:
15+
- cd hal
16+
- cargo check --features samv71q21b,unproven
17+
18+
same70n21b:
19+
stage: HAL
20+
script:
21+
- cd hal
22+
- cargo check --features same70n21b,unproven
23+
24+
e70:
25+
stage: examples
26+
script:
27+
- cd boards/atsame70_xpro
28+
- cargo check --examples
29+
30+
v71:
31+
stage: examples
32+
script:
33+
- cd boards/atsamv71_xult
34+
- cargo check --examples
35+
36+
fmt:
37+
stage: lint
38+
needs: []
39+
script:
40+
- cd hal
41+
- cargo fmt -- --check
42+
- cd ../boards/atsame70_xpro
43+
- cargo fmt -- --check
44+
- cd ../atsamv71_xult
45+
- cargo fmt -- --check
46+
47+
clippy:
48+
stage: lint
49+
allow_failure: true
50+
needs: ["samv71q21b"]
51+
script:
52+
- cd hal
53+
- cargo clippy --no-deps --features samv71q21b,unproven
54+
- cd ../boards/atsame70_xpro
55+
- cargo clippy --examples --no-deps
56+
- cd ../atsamv71_xult
57+
- cargo clippy --examples --no-deps

0 commit comments

Comments
 (0)