-
Notifications
You must be signed in to change notification settings - Fork 8
98 lines (79 loc) · 2.55 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
name: CI
on:
push:
paths-ignore:
- "**/README.md"
pull_request:
paths-ignore:
- "**/README.md"
merge_group:
schedule:
- cron: "50 7 * * *"
workflow_dispatch:
inputs:
all_combinations:
description: "Checks all combinations of options"
required: true
type: boolean
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SSID: ""
PASSWORD: ""
# Cancel any currently running workflows from the same PR, branch, or
# tag when a new workflow is triggered.
#
# https://stackoverflow.com/a/66336834
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
jobs:
# --------------------------------------------------------------------------
# Verify
verify:
name: "Check ${{ matrix.chip }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
chip: [esp32, esp32c2, esp32c3, esp32c6, esp32h2, esp32s2, esp32s3]
steps:
- uses: actions/checkout@v4
# Rust toolchain for Xtensa:
- if: ${{ contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.chip) }}
uses: esp-rs/xtensa-toolchain@v1.5
with:
default: true
buildtargets: ${{ matrix.chip }}
ldproxy: false
# Rust toolchain for RISC-V:
- if: ${{ !contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.chip) }}
uses: dtolnay/rust-toolchain@stable
with:
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf
components: clippy,rustfmt,rust-src
- uses: Swatinem/rust-cache@v2
- name: Generate and check project
if: github.event_name != 'schedule' && !inputs.all_combinations
run: cd xtask && cargo run -- check ${{ matrix.chip }}
- name: Generate and check project (all combinations)
if: github.event_name == 'schedule' || inputs.all_combinations
run: cd xtask && cargo run -- check ${{ matrix.chip }} --all-combinations
# --------------------------------------------------------------------------
# Test
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Run tests
run: cargo test
# --------------------------------------------------------------------------
# Lint
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Run clippy
run: cargo clippy -- -D warnings