Bumps the github-actions group with 1 update: [actions/cache](https://github.com/actions/cache). Updates `actions/cache` from 3 to 4 - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
103 lines
3.4 KiB
YAML
103 lines
3.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
# Build the Rust code.
|
|
build:
|
|
name: Checking ${{ matrix.build_target }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
build_target: [linux, macos, windows]
|
|
include:
|
|
- build_target: linux
|
|
os: ubuntu-latest
|
|
artifact_suffix: linux-x86_64
|
|
target: x86_64-unknown-linux-gnu
|
|
features: ''
|
|
- build_target: macos
|
|
os: macos-latest
|
|
artifact_suffix: macos-x86_64
|
|
target: x86_64-apple-darwin
|
|
features: '--no-default-features --features rodio_backend,cursive/pancurses-backend'
|
|
- build_target: windows
|
|
os: windows-latest
|
|
artifact_suffix: windows-x86_64
|
|
target: x86_64-pc-windows-msvc
|
|
features: '--no-default-features --features rodio_backend,pancurses_backend,share_clipboard,notify'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- 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 }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
components: clippy, rustfmt
|
|
- name: Install macOS dependencies
|
|
if: matrix.os == 'macos-latest'
|
|
run: brew install portaudio pkg-config
|
|
- name: Install Linux dependencies
|
|
if: matrix.os == 'ubuntu-latest'
|
|
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 check --locked --target ${{ matrix.target }} ${{ matrix.features }}
|
|
|
|
# Check Rust code formatting.
|
|
fmt:
|
|
name: Running `cargo fmt`
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
target: x86_64-unknown-linux-gnu
|
|
components: clippy, 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@v4
|
|
- 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 Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
target: x86_64-unknown-linux-gnu
|
|
components: clippy, rustfmt
|
|
- 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
|