Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Rust CI for WSLPlugins-rs

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

env:
CARGO_TERM_COLOR: always

jobs:
build-and-validate:
runs-on: windows-latest

strategy:
matrix:
toolchain: ["stable", "nightly"]

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Install Rust (Matrix)
shell: pwsh
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}

- name: Lint with Clippy (Stable Only)
if: matrix.toolchain == 'stable'
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Check Code Formatting (Stable Only)
if: matrix.toolchain == 'stable'
run: cargo fmt -- --check

- name: Build the Project
run: cargo build --verbose

- name: Run Tests
run: cargo test --verbose

- name: Generate Documentation (Stable Only)
if: matrix.toolchain == 'stable'
run: cargo doc --no-deps

- name: Generate Documentation for Docs.rs (Nightly Only)
if: matrix.toolchain == 'nightly'
shell: pwsh
run: |
$env:RUSTDOCFLAGS = "--cfg docsrs"
cargo +nightly doc --no-deps

- name: Install and Run Security Audit (Nightly Only)
if: matrix.toolchain == 'nightly'
run: |
cargo install cargo-audit
cargo audit