ci: check and build with features
This commit is contained in:
14
.github/workflows/build.yaml
vendored
14
.github/workflows/build.yaml
vendored
@@ -10,12 +10,17 @@ on:
|
||||
|
||||
jobs:
|
||||
errornowatcher:
|
||||
name: errornowatcher (${{ matrix.os }})
|
||||
name: errornowatcher (${{ matrix.os }}, ${{ matrix.feature.name }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-24.04, ubuntu-24.04-arm]
|
||||
feature:
|
||||
- name: default
|
||||
|
||||
- name: mimalloc
|
||||
flags: "-F mimalloc"
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
@@ -33,16 +38,15 @@ jobs:
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
target/
|
||||
key: build-${{ matrix.os }}-${{ hashFiles('**.toml', 'Cargo.*') }}
|
||||
key: build_${{ matrix.os }}_${{ matrix.feature.name }}_${{ hashFiles('**.toml', 'Cargo.*') }}
|
||||
|
||||
- name: Switch to nightly toolchain
|
||||
run: rustup default nightly
|
||||
|
||||
- name: Build in release mode
|
||||
run: cargo build --release
|
||||
- run: cargo build --release ${{ matrix.feature.flags }}
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: errornowatcher_${{ matrix.os }}
|
||||
name: errornowatcher_${{ matrix.feature.name }}_${{ matrix.os }}
|
||||
path: target/release/errornowatcher
|
||||
|
24
.github/workflows/lint.yaml
vendored
24
.github/workflows/lint.yaml
vendored
@@ -28,9 +28,23 @@ jobs:
|
||||
run: taplo fmt --check Cargo.toml
|
||||
|
||||
rust:
|
||||
name: Rust
|
||||
name: Rust (${{ matrix.feature.name }})
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
feature:
|
||||
- name: default
|
||||
|
||||
- name: minimal-mimalloc
|
||||
flags: "--no-default-features -F mimalloc"
|
||||
|
||||
- name: minimal
|
||||
flags: "--no-default-features"
|
||||
|
||||
- name: mimalloc
|
||||
flags: "-F mimalloc"
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -47,7 +61,7 @@ jobs:
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
target/
|
||||
key: build-${{ matrix.os }}-${{ hashFiles('**.toml', 'Cargo.*') }}
|
||||
key: build_${{ matrix.os }}_${{ matrix.feature.name }}_${{ hashFiles('**.toml', 'Cargo.*') }}
|
||||
|
||||
- name: Switch to nightly toolchain
|
||||
run: rustup default nightly
|
||||
@@ -55,9 +69,7 @@ jobs:
|
||||
- name: Install components
|
||||
run: rustup component add clippy rustfmt
|
||||
|
||||
- name: cargo clippy
|
||||
run: cargo clippy -- -D clippy::pedantic
|
||||
- run: cargo clippy ${{ matrix.feature.flags }} -- -D warnings -D clippy::pedantic
|
||||
|
||||
- name: cargo fmt
|
||||
if: always()
|
||||
- if: always()
|
||||
run: cargo fmt --check
|
||||
|
Reference in New Issue
Block a user