-
Notifications
You must be signed in to change notification settings - Fork 171
100 lines (86 loc) · 4.18 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
name: CI
on:
push:
branches:
- master
pull_request:
schedule:
- cron: "50 4 * * *"
workflow_dispatch:
env:
rust_toolchain: nightly
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
compile:
name: Compile
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- riscv32imc-esp-espidf
- xtensa-esp32-espidf
- xtensa-esp32s2-espidf
- xtensa-esp32s3-espidf
idf-version:
- release/v4.4
- release/v5.1
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
- name: Setup | libncurses5
run: sudo apt-get install libncurses5
- name: Setup | Rust
if: matrix.target == 'riscv32imc-esp-espidf'
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ env.rust_toolchain }}
components: rustfmt, clippy, rust-src
- name: Install Rust for Xtensa
if: matrix.target != 'riscv32imc-esp-espidf'
uses: esp-rs/xtensa-toolchain@v1.5.1
with:
default: true
version: "1.69.0"
- name: Build | Fmt Check
run: cargo fmt -- --check
- name: Build | Clippy
env:
ESP_IDF_VERSION: ${{ matrix.idf-version }}
ESP_IDF_SDKCONFIG_DEFAULTS: "${{ github.workspace }}/.github/configs/sdkconfig.defaults"
RUSTFLAGS: "${{ matrix.idf-version == 'release/v5.1' && '--cfg espidf_time64' || ''}}"
run: cargo clippy --no-deps --target ${{ matrix.target }} -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort -- -Dwarnings
- name: Build | Compile, all
env:
ESP_IDF_VERSION: ${{ matrix.idf-version }}
ESP_IDF_SDKCONFIG_DEFAULTS: "${{ github.workspace }}/.github/configs/sdkconfig.defaults"
RUSTFLAGS: "${{ matrix.idf-version == 'release/v5.1' && '--cfg espidf_time64' || ''}}"
run: cargo build --target ${{ matrix.target }} --features nightly,critical-section,embassy-sync,edge-executor,embedded-hal-async -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort
- name: Build | RISCV-ULP-HAL feature
env:
ESP_IDF_VERSION: ${{ matrix.idf-version }}
run: cargo build --features riscv-ulp-hal --no-default-features --target riscv32imc-unknown-none-elf -Zbuild-std=core,panic_abort -Zbuild-std-features=panic_immediate_abort
- name: Build | Compile, no_std
env:
ESP_IDF_VERSION: ${{ matrix.idf-version }}
ESP_IDF_SDKCONFIG_DEFAULTS: "${{ github.workspace }}/.github/configs/sdkconfig.defaults"
RUSTFLAGS: "${{ matrix.idf-version == 'release/v5.1' && '--cfg espidf_time64' || ''}}"
run: cargo build --features esp-idf-sys --no-default-features --target ${{ matrix.target }} -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort
- name: Build | Compile, no_std, alloc
env:
ESP_IDF_VERSION: ${{ matrix.idf-version }}
ESP_IDF_SDKCONFIG_DEFAULTS: "${{ github.workspace }}/.github/configs/sdkconfig.defaults"
RUSTFLAGS: "${{ matrix.idf-version == 'release/v5.1' && '--cfg espidf_time64' || ''}}"
run: cargo build --features alloc,esp-idf-sys --no-default-features --target ${{ matrix.target }} -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort
- name: Setup | ldproxy
if: matrix.target == 'riscv32imc-esp-espidf'
run: |
curl -L https://github.com/esp-rs/embuild/releases/latest/download/ldproxy-x86_64-unknown-linux-gnu.zip -o $HOME/.cargo/bin/ldproxy.zip
unzip "$HOME/.cargo/bin/ldproxy.zip" -d "$HOME/.cargo/bin/"
chmod a+x $HOME/.cargo/bin/ldproxy
- name: Build | Examples
env:
ESP_IDF_VERSION: ${{ matrix.idf-version }}
ESP_IDF_SDKCONFIG_DEFAULTS: "${{ github.workspace }}/.github/configs/sdkconfig.defaults"
RUSTFLAGS: "${{ matrix.idf-version == 'release/v5.1' && '--cfg espidf_time64' || ''}} ${{ matrix.target == 'riscv32imc-esp-espidf' && '-C default-linker-libraries' || ''}}"
run: cargo build --examples --target ${{ matrix.target }} -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort