diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4e3199245d..18d12ec877e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ # 1.) In the 'esp-hal' job, add the name of the chip to the `matrix.soc` array. # 1a.) If the device has a low-power core (which is supported in # `esp-lp-hal`), then update the `if` condition to build prerequisites. -# 2.) In the 'msrv-riscv' job, add checks as needed for the new chip. +# 2.) In the 'msrv' job, add checks as needed for the new chip. name: CI @@ -75,20 +75,13 @@ jobs: # Install the Rust toolchain for Xtensa devices: - uses: esp-rs/xtensa-toolchain@v1.5 with: - default: true ldproxy: false - # Install the Rust stable and nightly toolchains for RISC-V devices: - - uses: dtolnay/rust-toolchain@v1 - with: - target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf - toolchain: nightly - components: rust-src + # Install the Rust stable toolchain for RISC-V devices: - uses: dtolnay/rust-toolchain@v1 with: target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf toolchain: stable components: rust-src - - uses: Swatinem/rust-cache@v2 # Build all supported examples for the low-power core first (if present): @@ -115,13 +108,80 @@ jobs: - name: Check doc-tests run: cargo +esp xtask run-doc-test esp-hal ${{ matrix.device.soc }} - name: Check documentation - run: cargo xtask build-documentation --packages esp-hal --chips ${{ matrix.device.soc }} - # Run clippy + run: cargo +esp xtask build-documentation --packages esp-hal --chips ${{ matrix.device.soc }} + # Run Clippy - name: Clippy # We use the 'esp' toolchain for *all* targets, in order to get a # semi-stable and consistent set of lints for all targets: run: cargo +esp xtask lint-packages --chips ${{ matrix.device.soc }} + nightly: + name: nightly | esp-hal (${{ matrix.device.soc }}) + runs-on: ubuntu-latest + continue-on-error: true + env: + SSID: SSID + PASSWORD: PASSWORD + STATIC_IP: 1.1.1.1 + GATEWAY_IP: 1.1.1.1 + HOST_IP: 1.1.1.1 + + strategy: + fail-fast: false + matrix: + device: [ + { soc: "esp32c2", target: "riscv32imc-unknown-none-elf" }, + { soc: "esp32c3", target: "riscv32imc-unknown-none-elf" }, + { soc: "esp32c6", target: "riscv32imac-unknown-none-elf" }, + { soc: "esp32h2", target: "riscv32imac-unknown-none-elf" }, + ] + + steps: + - name: Set up cargo environment + run: | + # Convert the target triple from kebab-case to SCREAMING_SNAKE_CASE: + big_target=$(echo "${{ matrix.device.target }}" | tr [:lower:] [:upper:] | tr '-' '_') + # Set the *target specific* RUSTFLAGS for the current device: + echo "CARGO_TARGET_${big_target}_RUSTFLAGS=-Dwarnings" >> $GITHUB_ENV + + - uses: actions/checkout@v4 + + # Install the Rust nightly toolchain for RISC-V devices: + - uses: dtolnay/rust-toolchain@v1 + with: + target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf + toolchain: nightly + components: rust-src, clippy + + - uses: Swatinem/rust-cache@v2 + + # Build all supported examples for the low-power core first (if present): + - if: contains(fromJson('["esp32c6"]'), matrix.device.soc) + name: Build prerequisite examples (esp-lp-hal) + run: cargo xtask build-examples esp-lp-hal ${{ matrix.device.soc }} + + # Make sure we're able to build the HAL without the default features + # enabled: + - name: Build (no features) + run: | + cargo xtask build-package \ + --no-default-features \ + --toolchain=nightly \ + --features=${{ matrix.device.soc }} \ + --target=${{ matrix.device.target }} \ + esp-hal + # Build all supported examples for the specified device: + - name: Build (examples) + run: cargo xtask build-examples esp-hal ${{ matrix.device.soc }} + # Check doc-tests + - name: Check doc-tests + run: cargo +nightly xtask run-doc-test esp-hal ${{ matrix.device.soc }} + - name: Check documentation + run: cargo +nightly xtask build-documentation --packages esp-hal --chips ${{ matrix.device.soc }} + # Run Clippy + - name: Clippy + run: cargo +nightly xtask lint-packages --chips ${{ matrix.device.soc }} + extras: runs-on: ubuntu-latest @@ -152,10 +212,8 @@ jobs: steps: - uses: actions/checkout@v4 - # install esp toolchain first so it isn't set as the default - uses: esp-rs/xtensa-toolchain@v1.5 with: - default: true ldproxy: false version: ${{ env.MSRV }} - uses: dtolnay/rust-toolchain@v1 @@ -232,7 +290,7 @@ jobs: steps: - uses: actions/checkout@v4 - + # Install the Rust toolchain for RISC-V devices: - if: ${{ !contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.target.soc) }} uses: dtolnay/rust-toolchain@v1 @@ -245,7 +303,6 @@ jobs: uses: esp-rs/xtensa-toolchain@v1.5 with: buildtargets: ${{ matrix.target.soc }} - default: true ldproxy: false - uses: Swatinem/rust-cache@v2 diff --git a/xtask/src/main.rs b/xtask/src/main.rs index e5953ea362e..ceb664f1069 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -644,9 +644,7 @@ fn lint_packages(workspace: &Path, args: LintPackagesArgs) -> Result<()> { fn lint_package(path: &Path, args: &[&str]) -> Result<()> { log::info!("Linting package: {}", path.display()); - let mut builder = CargoArgsBuilder::default() - .toolchain("esp") - .subcommand("clippy"); // TODO: Is this still actually required? + let mut builder = CargoArgsBuilder::default().subcommand("clippy"); for arg in args { builder = builder.arg(arg.to_string());