Simplify CI setup #221
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: CI | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- run: cargo fmt --check | |
- run: cargo clippy --all-targets | |
- uses: EmbarkStudios/cargo-deny-action@v2 | |
doc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker://asciidoctor/docker-asciidoctor | |
with: | |
args: -b manpage -a reproducible git-gone.1.adoc | |
test: | |
strategy: | |
matrix: | |
target: | |
# Linux default | |
- x86_64-unknown-linux-gnu | |
# For statically linked release builds | |
- x86_64-unknown-linux-musl | |
# macOS | |
- x86_64-apple-darwin | |
# Windows | |
- x86_64-pc-windows-msvc | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-unknown-linux-musl | |
os: ubuntu-latest | |
flags: --no-default-features | |
- target: x86_64-apple-darwin | |
os: macOS-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
# Install musl tools for musl target | |
- name: Install musl tools | |
run: sudo apt-get install musl-tools | |
if: "contains(matrix.target, 'musl')" | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- run: cargo build --all-targets --target ${{ matrix.target }} | |
- run: cargo test --target ${{ matrix.target }} |