name: Test and Build Release
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
test-and-build:
name: Test and build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14]
steps:
- name: Check out source
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with:
persist-credentials: false
- name: Install Rust
run: rustup toolchain install stable --profile minimal --component rustfmt --component clippy
- name: Check formatting
run: cargo +stable fmt --check
- name: Run Clippy
run: cargo +stable clippy --locked --all-targets -- -D warnings
- name: Run tests
run: cargo +stable test --locked
- name: Check compatibility documentation
env:
RUSTUP_TOOLCHAIN: stable
run: ./scripts/check-compatibility-docs.sh
- name: Check upgrade compatibility
env:
RUSTUP_TOOLCHAIN: stable
run: ./scripts/check-compatibility.sh
- name: Build release
run: cargo +stable build --locked --release
- name: Smoke test release
run: ./target/release/qqq --help
- name: Package release
run: tar -czf qqq-${{ runner.os }}-${{ runner.arch }}.tar.gz -C target/release qqq
- name: Upload release archive
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 with:
name: qqq-${{ runner.os }}-${{ runner.arch }}
path: qqq-${{ runner.os }}-${{ runner.arch }}.tar.gz
if-no-files-found: error
retention-days: 14