name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: zlicenser
- uses: actions/checkout@v4
with:
repository: zal-analytics/zlicenser-protocol
path: zlicenser-protocol
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: "zlicenser -> target"
- run: cargo test -p zlicenser
working-directory: zlicenser
- run: cargo test -p zlicenser --all-features
working-directory: zlicenser
- run: cargo test -p zlicenser --no-default-features
working-directory: zlicenser
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: zlicenser
- uses: actions/checkout@v4
with:
repository: zal-analytics/zlicenser-protocol
path: zlicenser-protocol
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: "zlicenser -> target"
- run: cargo clippy --workspace --exclude zlicenser-gui --all-features -- -D warnings
working-directory: zlicenser
- run: cargo clippy -p zlicenser --no-default-features -- -D warnings
working-directory: zlicenser
clippy-gui:
name: Clippy (GUI)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: zlicenser
- uses: actions/checkout@v4
with:
repository: zal-analytics/zlicenser-protocol
path: zlicenser-protocol
- name: Install Tauri system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: "zlicenser -> target"
- run: cargo clippy -p zlicenser-gui -- -D warnings
working-directory: zlicenser
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --check
deny:
name: Deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: zlicenser
- uses: actions/checkout@v4
with:
repository: zal-analytics/zlicenser-protocol
path: zlicenser-protocol
- uses: EmbarkStudios/cargo-deny-action@v2
with:
manifest-path: zlicenser/Cargo.toml
audit:
name: Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: baptiste0928/cargo-install@v3
with:
crate: cargo-audit
- run: |
if cargo audit --ignore RUSTSEC-2023-0071 > /tmp/audit.log 2>&1; then
echo "No vulnerabilities found."
else
cat /tmp/audit.log
exit 1
fi