Skip to content

chore(deps): bump anyhow from 1.0.100 to 1.0.102 #54

chore(deps): bump anyhow from 1.0.100 to 1.0.102

chore(deps): bump anyhow from 1.0.100 to 1.0.102 #54

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: 1
jobs:
# Check code formatting
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
# Run clippy lints
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-clippy-
${{ runner.os }}-cargo-
- name: Run clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
# Run tests
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
rust: [nightly] # Current nightly
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: ${{ matrix.rust }}
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ matrix.rust }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.rust }}-cargo-test-
${{ runner.os }}-${{ matrix.rust }}-cargo-
- name: Run tests
run: cargo test --workspace --all-features
# Build release binaries
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
# - os: macos-latest
# target: x86_64-apple-darwin
# - os: macos-latest
# target: aarch64-apple-darwin
# - os: windows-latest
# target: x86_64-pc-windows-msvc
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
targets: ${{ matrix.target }}
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ matrix.target }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.target }}-cargo-build-
${{ runner.os }}-${{ matrix.target }}-cargo-
- name: Build release
run: cargo build --release --workspace --target ${{ matrix.target }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: placy-${{ matrix.target }}
path: |
target/${{ matrix.target }}/release/placy
target/${{ matrix.target }}/release/placy.exe
target/${{ matrix.target }}/release/placy-server
target/${{ matrix.target }}/release/placy-server.exe
if-no-files-found: ignore
# Check documentation
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-docs-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-docs-
${{ runner.os }}-cargo-
- name: Check documentation
run: cargo doc --workspace --no-deps --all-features
env:
RUSTDOCFLAGS: -Dwarnings
# Security audit
security:
runs-on: ubuntu-latest
permissions:
checks: write
issues: write
pull-requests: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- uses: Swatinem/rust-cache@v2
- name: Run security audit
uses: rustsec/audit-check@v2.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Check for unused dependencies
udeps:
name: Unused Dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: cargo-machete
uses: bnjbvr/cargo-machete@main
continue-on-error: true
# All checks passed
ci-success:
name: CI Success
needs: [fmt, clippy, test, build, docs]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check all jobs passed
run: |
if [[ "${{ needs.fmt.result }}" != "success" ]] || \
[[ "${{ needs.clippy.result }}" != "success" ]] || \
[[ "${{ needs.test.result }}" != "success" ]] || \
[[ "${{ needs.build.result }}" != "success" ]] || \
[[ "${{ needs.docs.result }}" != "success" ]]; then
echo "One or more required jobs failed"
exit 1
fi
echo "All required CI checks passed!"