Skip to content

Update REPO_METADATA_TODO.md #18

Update REPO_METADATA_TODO.md

Update REPO_METADATA_TODO.md #18

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
# Detect docs-only changes to skip heavy jobs
docs-scope:
runs-on: ubuntu-latest
outputs:
docs_only: ${{ steps.check.outputs.docs_only }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect docs-only changes
id: check
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
BASE="${{ github.event.pull_request.base.sha }}"
else
BASE="${{ github.event.before }}"
fi
if git diff --name-only "$BASE" HEAD | grep -qvE '^(docs/|\.md$|\.mdx$)'; then
echo "docs_only=false" >> "$GITHUB_OUTPUT"
else
echo "docs_only=true" >> "$GITHUB_OUTPUT"
fi
# Rust checks and tests
rust-checks:
needs: [docs-scope]
if: needs.docs-scope.outputs.docs_only != 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [stable, nightly]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
crates/constraint-theory-core/target
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ matrix.rust }}-
- name: Check formatting
working-directory: crates/constraint-theory-core
run: cargo fmt --check
- name: Run clippy
working-directory: crates/constraint-theory-core
run: cargo clippy --all-targets -- -D warnings
- name: Run tests
working-directory: crates/constraint-theory-core
run: cargo test --release
- name: Build docs
working-directory: crates/constraint-theory-core
run: cargo doc --no-deps
# Security audit
security-scan:
needs: [docs-scope]
if: needs.docs-scope.outputs.docs_only != 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Rust security audit
uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}