mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 11:58:29 +00:00
114 lines
2.7 KiB
YAML
114 lines
2.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- main
|
|
- dev
|
|
pull_request:
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUSTFLAGS: -Dwarnings
|
|
|
|
jobs:
|
|
checks:
|
|
name: fmt / clippy / check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt, clippy
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Format
|
|
run: cargo fmt --all --check
|
|
|
|
- name: Clippy (default features)
|
|
run: cargo clippy --all-targets -- -D warnings
|
|
|
|
- name: Clippy (all features)
|
|
run: cargo clippy --all-targets --all-features -- -D warnings
|
|
|
|
- name: Check (all features)
|
|
run: cargo check --all-targets --all-features
|
|
|
|
test:
|
|
name: tests (${{ matrix.os }})
|
|
needs: checks
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Install Linux tools
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
build-essential \
|
|
clang \
|
|
nasm \
|
|
clang-format \
|
|
clang-tidy \
|
|
git
|
|
|
|
- name: Install macOS tools
|
|
if: runner.os == 'macOS'
|
|
run: |
|
|
brew install nasm llvm || true
|
|
echo "$(brew --prefix llvm)/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Install Windows tools
|
|
if: runner.os == 'Windows'
|
|
shell: pwsh
|
|
run: |
|
|
choco install nasm -y
|
|
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
|
|
- name: Unit tests (binary crate)
|
|
run: cargo test --bins -- --nocapture
|
|
|
|
- name: Integration tests (default features)
|
|
run: cargo test --tests -- --nocapture
|
|
|
|
- name: Integration tests (archive feature)
|
|
if: runner.os != 'Windows'
|
|
run: cargo test --tests --features archive -- --nocapture
|
|
|
|
test-archive-linux:
|
|
name: archive feature smoke
|
|
needs: checks
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Install tools
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y build-essential clang nasm
|
|
|
|
- name: Build with archive
|
|
run: cargo build --features archive
|
|
|
|
- name: Flat-bin + unit suite with archive
|
|
run: cargo test --features archive --test cli_build --test cli_workspace --test cli_errors -- --nocapture
|