Skip to content

use cache for category and channel data #38

use cache for category and channel data

use cache for category and channel data #38

Workflow file for this run

name: Rust
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0'
env:
CARGO_TERM_COLOR: always
jobs:
checks:
name: Check
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 'stable'
- 'beta'
- '1.75.0'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Check build
run: cargo check --workspace
lints:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy, rustfmt
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: common
cache-all-crates: 'true'
- name: Install required cargo crates
run: cargo install --locked clippy-sarif sarif-fmt cargo-machete cargo-deny cargo-audit
- name: Check formatting
run: cargo fmt --all -- --check
- name: Check documentation
run: cargo doc --workspace --no-deps
- name: Check dependencies
run: cargo machete --with-metadata
- name: Check licenses and security
run: cargo deny check
- name: Perform linting
run:
cargo clippy
--workspace
--all-features
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
continue-on-error: true
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true
- name: Perform audit
run: cargo audit
tests:
name: Test
runs-on: ubuntu-latest
needs: [checks, lints]
strategy:
matrix:
rust:
- 'stable'
- 'beta'
- '1.75.0'
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: common
cache-all-crates: 'true'
- name: Run tests
run: cargo test --workspace --verbose --all-features