Pigg 384 #1941
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test with Coverage | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
schedule: # Build every day at 5PM UTC | |
- cron: '0 17 * * *' | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_INCREMENTAL: 0 | |
RUSTFLAGS: -C instrument-coverage | |
LLVM_PROFILE_FILE: pigg-%p-%m.profraw | |
RUST_BACKTRACE: 1 | |
jobs: | |
markdown-link-check: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: gaurav-nelson/github-action-markdown-link-check@v1 | |
Format-check: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run cargo fmt check | |
run: cargo fmt --all -- --check | |
all-feature-combinations: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install cargo-all-features | |
run: cargo install cargo-all-features | |
- name: cargo check-all-features | |
run: cargo check-all-features | |
arm7-build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clean up files | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Add target | |
run: rustup target add armv7-unknown-linux-gnueabihf | |
- name: Install armv7 Linker | |
run: | | |
sudo apt update | |
sudo apt install -y gcc-arm-linux-gnueabihf | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build for armv7 | |
run: cargo build --target=armv7-unknown-linux-gnueabihf | |
arm7-musl-build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clean up files | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Add target | |
run: rustup target add armv7-unknown-linux-musleabihf | |
- name: Install armv7 Linker | |
run: | | |
sudo apt update | |
sudo apt install -y gcc-arm-linux-gnueabihf | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build for armv7-musl | |
run: RUSTFLAGS= cargo build --target=armv7-unknown-linux-musleabihf | |
aarch64-build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clean up files | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Add target | |
run: rustup target add aarch64-unknown-linux-gnu | |
- name: Install aarch64 Linker | |
run: | | |
sudo apt update | |
sudo apt install -y gcc-aarch64-linux-gnu | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build for aarch64 | |
run: cargo build --target=aarch64-unknown-linux-gnu | |
porky-release-build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: add thumbv6m-none-eabi target | |
run: rustup target add thumbv6m-none-eabi | |
- name: Install cargo binstall | |
run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash | |
- name: Install elf2uf2-rs | |
run: cargo binstall elf2uf2-rs | |
- name: Build porky and porky_w and their UF2 files | |
run: cd porky && RUSTFLAGS= make uf2 | |
clippy-build-and-test-matrix: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macos-15, ubuntu-24.04, windows-latest ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy,llvm-tools-preview | |
- uses: Swatinem/rust-cache@v2 | |
- name: InstallCoverageTools | |
if: runner.os != 'Windows' | |
run: cargo install grcov | |
- name: Setup LCOV | |
if: runner.os != 'Windows' | |
uses: hrishikesh-kadam/setup-lcov@v1 | |
with: | |
ref: HEAD | |
- name: Clippy build and test - non-Linux | |
if: runner.os != 'Linux' | |
run: make clippy build test | |
- name: Clippy build and test - Linux | |
if: runner.os == 'Linux' | |
run: | | |
make clippy build | |
sudo apt-get update | |
sudo apt-get install weston | |
weston -Bheadless -Sweston & | |
make test | |
env: | |
WAYLAND_DISPLAY: weston | |
- name: Clean up coverage | |
if: runner.os != 'Windows' | |
run: | | |
grcov . --binary-path target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info | |
lcov --ignore-errors unused --ignore-errors unsupported --ignore-errors empty,empty --remove lcov.info -o lcov.info --erase-functions "(?=^.*fmt).+" | |
- name: UploadCoverage | |
if: runner.os != 'Windows' | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
file: lcov.info | |
flags: unittests | |
name: codecov-umbrella | |
verbose: true |