chore: add ci tests

This commit is contained in:
zhom
2025-07-28 01:36:12 +04:00
parent 88e4e91883
commit 9fe9a1e030
3 changed files with 195 additions and 0 deletions
+151
View File
@@ -0,0 +1,151 @@
name: Cross-Platform Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test Suite
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
name: Linux x64
- os: ubuntu-22.04-arm
target: aarch64-unknown-linux-gnu
name: Linux ARM64
- os: macos-latest
target: x86_64-apple-darwin
name: macOS x64
- os: macos-latest
target: aarch64-apple-darwin
name: macOS ARM64
- os: windows-latest
target: x86_64-pc-windows-msvc
name: Windows x64
- os: windows-11-arm
target: aarch64-pc-windows-msvc
name: Windows ARM64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install dependencies (Ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Check code formatting
run: cargo fmt --all -- --check
- name: Run Clippy
run: cargo clippy --target ${{ matrix.target }} --all-targets --all-features -- -D warnings
- name: Build
run: cargo build --target ${{ matrix.target }} --verbose
- name: Run tests
run: cargo test --target ${{ matrix.target }} --verbose
- name: Build release
run: cargo build --target ${{ matrix.target }} --release --verbose
# Test installation from crates.io simulation
install-test:
name: Installation Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-22.04-arm, windows-11-arm]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies (Ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Install banderole locally
run: cargo install --path .
- name: Test banderole installation
run: banderole --version
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Install cargo-audit
run: cargo install cargo-audit
- name: Run security audit
run: cargo audit
- name: Install cargo-deny
run: cargo install cargo-deny
- name: Run cargo-deny
run: cargo deny check
# Minimum Supported Rust Version (MSRV) check
msrv:
name: MSRV Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install MSRV Rust toolchain
uses: dtolnay/rust-toolchain@1.70.0
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Check MSRV compatibility
run: cargo check --all-targets --all-features
+5
View File
@@ -1,11 +1,15 @@
{
"cSpell.words": [
"chrono",
"Clippy",
"dtolnay",
"enabledelayedexpansion",
"ERRORLEVEL",
"LOCALAPPDATA",
"lockfiles",
"mktemp",
"msrv",
"msvc",
"nvmrc",
"outpath",
"readlink",
@@ -15,6 +19,7 @@
"serde",
"setlocal",
"sindresorhus",
"Swatinem",
"taskkill",
"USERPROFILE",
"walkdir",
+39
View File
@@ -0,0 +1,39 @@
# Configuration for cargo-deny
[licenses]
allow = [
"MIT",
"Apache-2.0",
"Apache-2.0 WITH LLVM-exception",
"BSD-2-Clause",
"BSD-3-Clause",
"ISC",
"Unicode-DFS-2016",
]
deny = [
"GPL-2.0",
"GPL-3.0",
"AGPL-1.0",
"AGPL-3.0",
]
multiple-versions = "warn"
confidence-threshold = 0.8
[bans]
multiple-versions = "warn"
[advisories]
db-path = "~/.cargo/advisory-db"
db-urls = ["https://github.com/rustsec/advisory-db"]
vulnerability = "deny"
unmaintained = "warn"
yanked = "warn"
notice = "warn"
[sources]
unknown-registry = "warn"
unknown-git = "warn"
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
allow-git = []