Skip to content

Commit

Permalink
Deny warnings in CI (#1877)
Browse files Browse the repository at this point in the history
* Deny warnings when building in CI

* Build RISC-V using `stable` release channel again
  • Loading branch information
jessebraham authored Jul 30, 2024
1 parent dd2e475 commit 81f3776
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MSRV: "1.76.0"
RUSTDOCFLAGS: -Dwarnings

# Cancel any currently running workflows from the same PR, branch, or
# tag when a new workflow is triggered.
Expand Down Expand Up @@ -62,6 +63,13 @@ jobs:
]

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 toolchain for Xtensa devices:
Expand All @@ -73,12 +81,12 @@ jobs:
- uses: dtolnay/rust-toolchain@v1
with:
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf
toolchain: stable
toolchain: nightly
components: rust-src
- uses: dtolnay/rust-toolchain@v1
with:
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf
toolchain: nightly
toolchain: stable
components: rust-src

- uses: Swatinem/rust-cache@v2
Expand All @@ -89,7 +97,7 @@ jobs:
run: cargo xtask build-examples esp-lp-hal ${{ matrix.device.soc }}
- if: contains(fromJson('["esp32c6", "esp32s2", "esp32s3"]'), matrix.device.soc)
name: Check esp-lp-hal documentation
run: RUSTDOCFLAGS="-D warnings" cargo xtask build-documentation --packages esp-lp-hal --chips ${{ matrix.device.soc }}
run: cargo xtask build-documentation --packages esp-lp-hal --chips ${{ matrix.device.soc }}

# Make sure we're able to build the HAL without the default features
# enabled:
Expand All @@ -107,7 +115,7 @@ jobs:
- name: Check doc-tests
run: cargo +esp xtask run-doc-test esp-hal ${{ matrix.device.soc }}
- name: Check documentation
run: RUSTDOCFLAGS="-D warnings" cargo xtask build-documentation --packages esp-hal --chips ${{ matrix.device.soc }}
run: cargo 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
Expand Down Expand Up @@ -224,8 +232,8 @@ jobs:

steps:
- uses: actions/checkout@v4
# Install the Rust toolchain for RISC-V devices:


# Install the Rust toolchain for RISC-V devices:
- if: ${{ !contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.target.soc) }}
uses: dtolnay/rust-toolchain@v1
with:
Expand Down

0 comments on commit 81f3776

Please sign in to comment.