-
-
Notifications
You must be signed in to change notification settings - Fork 28
114 lines (95 loc) · 3.62 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
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- thumbv7em-none-eabi
- thumbv6m-none-eabi # like the Cortex-M0+
- x86_64-unknown-linux-gnu
- x86_64-pc-windows-msvc
steps:
- name: Install build dependencies
shell: bash
run: |
env && pwd && sudo apt-get update -y -qq && sudo apt-get install -y -qq llvm libc6-dev-i386 libclang-dev
- uses: fiam/arm-none-eabi-gcc@v1
with:
release: "9-2020-q2"
- name: Install rust
run: rustup show
- uses: actions/checkout@v3
- name: Check
run: |
cargo check --package littlefs2-core
cargo check --package littlefs2-core --features heapless-bytes03
cargo check --package littlefs2-core --features heapless-bytes04
cargo check --package littlefs2-core --features heapless07
cargo check --package littlefs2-core --features heapless08
cargo check --package littlefs2-core --features serde
cargo check --package littlefs2-core --all-features
cargo check --workspace --all-targets
cargo check --workspace --all-targets --all-features
cargo check --workspace --all-targets --no-default-features
cargo check --workspace --all-targets --no-default-features --features serde
- name: Build
run: cargo build --workspace --release --verbose
- name: Run clippy
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: cargo clippy --workspace --all-features --all-targets -- --deny warnings
- name: Check code format
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: cargo fmt --all -- --check
- name: Run tests
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: >
cargo test --workspace &&
cargo test --workspace --release
- name: Check documentation
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --workspace
build-avr:
runs-on: ubuntu-latest
steps:
- name: Install build dependencies
shell: bash
run: |
env && pwd && sudo apt-get update -y -qq && sudo apt-get install -y -qq llvm gcc-avr avr-libc libclang-dev
- name: Install rust
run: rustup toolchain install --profile minimal --component=rust-src nightly
- uses: actions/checkout@v3
- name: Configure target
run: |
cat <<EOT > avr-atmega328p.json
{
"arch": "avr",
"atomic-cas": false,
"cpu": "atmega328p",
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
"eh-frame-header": false,
"exe-suffix": ".elf",
"late-link-args": {
"gcc": [
"-lgcc"
]
},
"linker": "avr-gcc",
"llvm-target": "avr-unknown-unknown",
"max-atomic-width": 8,
"no-default-libraries": false,
"pre-link-args": {
"gcc": [
"-mmcu=atmega328p"
]
},
"relocation-model": "static",
"target-c-int-width": "16",
"target-pointer-width": "16"
}
EOT
- name: Patch delog
run: echo 'delog = { version = "0.1.6", git = "https://github.com/LechevSpace/delog.git", rev = "e83f3fd" }' >> Cargo.toml
- name: Build avr
run: cargo +nightly build -Z build-std=core --target=./avr-atmega328p.json --workspace --release