Skip to content

Deny warnings in CI #1877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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