Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 5 to 6 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
111 lines
3.8 KiB
YAML
111 lines
3.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
env:
|
|
TERM: xterm
|
|
|
|
jobs:
|
|
# Build the Rust code.
|
|
build:
|
|
name: Checking ${{ matrix.build_target }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- build_target: linux-x86_64
|
|
os: ubuntu-latest
|
|
target: x86_64-unknown-linux-gnu
|
|
features: ''
|
|
- build_target: linux-arm64
|
|
os: ubuntu-24.04-arm
|
|
target: aarch64-unknown-linux-gnu
|
|
features: ''
|
|
- build_target: macos-aarch64
|
|
os: macos-14
|
|
target: aarch64-apple-darwin
|
|
features: '--no-default-features --features rodio_backend,pancurses_backend'
|
|
- build_target: windows-x86_64
|
|
os: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
features: '--no-default-features --features rodio_backend,pancurses_backend,share_clipboard,notify'
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/cache@v4
|
|
name: Cache build data
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
target/
|
|
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
- name: Install rustup
|
|
if: runner.os != 'Windows'
|
|
shell: bash
|
|
run: |
|
|
if ! command -v rustup &>/dev/null; then
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --target ${{ matrix.target }} -y
|
|
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
|
|
fi
|
|
- name: Install clippy + rustfmt
|
|
run: rustup component add clippy rustfmt
|
|
- name: Install macOS dependencies
|
|
if: matrix.os == 'macos-latest'
|
|
run: brew install portaudio pkg-config
|
|
- name: Install Linux dependencies
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install libpulse-dev libdbus-1-dev libncursesw5-dev libxcb-shape0-dev libxcb-xfixes0-dev
|
|
- name: Running cargo build
|
|
run: cargo build --locked --target ${{ matrix.target }} ${{ matrix.features }}
|
|
- name: Running cargo test
|
|
run: cargo test --locked --target ${{ matrix.target }} ${{ matrix.features }}
|
|
|
|
# Check Rust code formatting.
|
|
fmt:
|
|
name: Running `cargo fmt`
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Install rustup
|
|
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
- name: Install clippy + rustfmt
|
|
run: rustup component add rustfmt
|
|
- name: cargo fmt
|
|
run: cargo fmt --all -- --check
|
|
|
|
# Run `cargo clippy` on all the targets in all workspace members with all
|
|
# features enabled, and return an error if there are any clippy suggestions.
|
|
clippy:
|
|
name: Running `cargo clippy`
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/cache@v4
|
|
name: Cache build data
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
target/
|
|
key: ${{ runner.os }}-clippy-${{ hashFiles('**/Cargo.lock') }}
|
|
- name: Install rustup
|
|
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
- name: Install clippy + rustfmt
|
|
run: rustup component add clippy
|
|
- name: Install Linux dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install portaudio19-dev libasound2-dev libpulse-dev libdbus-1-dev libncursesw5-dev libxcb-shape0-dev libxcb-xfixes0-dev
|
|
- name: cargo clippy
|
|
run: cargo clippy --locked --no-deps --workspace --all-targets --all-features --verbose -- -D warnings
|