Skip to content

Commit b0a55a8

Browse files
committed
Add a CI workflow to verify the package(s) in the repository
1 parent 1c16338 commit b0a55a8

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Check package
2+
description: Check a package for the given chip and build target
3+
4+
inputs:
5+
package:
6+
description: Name of the package to check
7+
required: true
8+
soc:
9+
description: SoC to target
10+
required: true
11+
target:
12+
description: Build target of the SoC
13+
required: true
14+
15+
runs:
16+
using: composite
17+
steps:
18+
# Build the package (RISC-V):
19+
- if: ${{ startsWith(inputs.target, 'riscv') }}
20+
shell: bash
21+
run: |
22+
cd ${{ inputs.package }}
23+
cargo check --features=${{ inputs.soc }} --target=${{ inputs.target }}
24+
25+
# Build the package (Xtensa):
26+
- if: ${{ startsWith(inputs.target, 'xtensa') }}
27+
shell: bash
28+
run: |
29+
cd ${{ inputs.package }}
30+
cargo check -Zbuild-std=core --features=${{ inputs.soc }} --target=${{ inputs.target }}

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
workflow_dispatch:
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
# Cancel any currently running workflows from the same PR, branch, or
12+
# tag when a new workflow is triggered.
13+
#
14+
# https://stackoverflow.com/a/66336834
15+
concurrency:
16+
cancel-in-progress: true
17+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
18+
19+
jobs:
20+
# --------------------------------------------------------------------------
21+
# Check
22+
23+
check:
24+
runs-on: ubuntu-latest
25+
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
device: [
30+
# RISC-V devices:
31+
{ soc: "esp32c2", target: "riscv32imc-unknown-none-elf" },
32+
{ soc: "esp32c3", target: "riscv32imc-unknown-none-elf" },
33+
{ soc: "esp32c6", target: "riscv32imac-unknown-none-elf" },
34+
{ soc: "esp32h2", target: "riscv32imac-unknown-none-elf" },
35+
# Xtensa devices:
36+
{ soc: "esp32", target: "xtensa-esp32-none-elf" },
37+
{ soc: "esp32s2", target: "xtensa-esp32s2-none-elf" },
38+
{ soc: "esp32s3", target: "xtensa-esp32s3-none-elf" },
39+
]
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
# Install the Rust stable toolchain for RISC-V devices:
45+
- if: ${{ startsWith(matrix.device.target, 'riscv32') }}
46+
uses: dtolnay/rust-toolchain@stable
47+
with:
48+
components: rust-src
49+
target: ${{ matrix.device.target }}
50+
# Install the Rust toolchain for Xtensa devices:
51+
- if: ${{ startsWith(matrix.device.target, 'xtensa') }}
52+
uses: esp-rs/[email protected]
53+
with:
54+
default: true
55+
ldproxy: false
56+
57+
- uses: Swatinem/rust-cache@v2
58+
59+
# NOTE: The ESP32-C2 does *not* have the RMT peripheral
60+
- if: ${{ matrix.device.soc != 'esp32c2' }}
61+
name: Check esp-hal-smartled
62+
uses: ./.github/actions/check-package
63+
with:
64+
package: esp-hal-smartled
65+
soc: ${{ matrix.device.soc }}
66+
target: ${{ matrix.device.target }}

0 commit comments

Comments
 (0)