Skip to content

HIL: Allow manually running tests on other repos/branches (#625) #1

HIL: Allow manually running tests on other repos/branches (#625)

HIL: Allow manually running tests on other repos/branches (#625) #1

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main
paths-ignore:
- "**/hil.yml"
- "**/*.md"
push:
paths-ignore:
- "**/hil.yml"
- "**/*.md"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
# 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:
# --------------------------------------------------------------------------
# Check
check:
name: Check (${{ matrix.platform.target }})
strategy:
fail-fast: false
matrix:
platform:
- os: "macos-12"
target: "x86_64-apple-darwin"
arch: "x86_64"
- os: "ubuntu-22.04"
target: "x86_64-unknown-linux-gnu"
arch: "x86_64"
- os: "ubuntu-22.04"
target: "x86_64-unknown-linux-musl"
arch: "x86_64"
- os: "windows-2022"
target: "x86_64-pc-windows-msvc"
arch: "x86_64"
- os: "ubuntu-22.04"
target: "aarch64-unknown-linux-gnu"
arch: "arm64"
- os: "ubuntu-22.04"
target: "armv7-unknown-linux-gnueabihf"
arch: "armhf"
runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-target
with:
arch: ${{ matrix.platform.arch }}
target: ${{ matrix.platform.target }}
- run: cargo check
check-lib:
name: Check lib (${{ matrix.platform.target }})
strategy:
fail-fast: false
matrix:
platform:
- target: "x86_64-unknown-linux-gnu"
arch: "x86_64"
- target: "aarch64-unknown-linux-gnu"
arch: "arm64"
- target: "armv7-unknown-linux-gnueabihf"
arch: "armhf"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-target
with:
arch: ${{ matrix.platform.arch }}
target: ${{ matrix.platform.target }}
- run: cargo check -p espflash --lib --no-default-features
- run: cargo check -p espflash --lib --no-default-features --features serialport
msrv:
name: Check MSRV (${{ matrix.platform.target }})
strategy:
fail-fast: false
matrix:
platform:
- target: "x86_64-unknown-linux-gnu"
arch: "x86_64"
- target: "aarch64-unknown-linux-gnu"
arch: "arm64"
- target: "armv7-unknown-linux-gnueabihf"
arch: "armhf"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-target
with:
arch: ${{ matrix.platform.arch }}
target: ${{ matrix.platform.target }}
toolchain: "1.74"
- run: cargo check
# --------------------------------------------------------------------------
# Test
test:
name: Unit Tests (${{ matrix.platform.target }})
strategy:
fail-fast: false
matrix:
platform:
- target: "x86_64-unknown-linux-gnu"
arch: "x86_64"
- target: "aarch64-unknown-linux-gnu"
arch: "arm64"
- target: "armv7-unknown-linux-gnueabihf"
arch: "armhf"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-target
with:
arch: ${{ matrix.platform.arch }}
target: ${{ matrix.platform.target }}
- run: cargo test --lib
# --------------------------------------------------------------------------
# Lint
clippy:
name: Clippy (${{ matrix.platform.target }})
strategy:
fail-fast: false
matrix:
platform:
- target: "x86_64-unknown-linux-gnu"
arch: "x86_64"
- target: "aarch64-unknown-linux-gnu"
arch: "arm64"
- target: "armv7-unknown-linux-gnueabihf"
arch: "armhf"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-target
with:
arch: ${{ matrix.platform.arch }}
target: ${{ matrix.platform.target }}
components: clippy
- run: cargo clippy -- -D warnings -A clippy::too_many_arguments
rustfmt:
name: Rustfmt
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check