example file protextion (#234) #601
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI (Nix) | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| # Cancel in-progress runs for the same branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Nix | |
| uses: DeterminateSystems/nix-installer-action@v14 | |
| with: | |
| logger: pretty | |
| - name: Setup Magic Nix Cache | |
| uses: DeterminateSystems/magic-nix-cache-action@v8 | |
| - name: Flake checker | |
| uses: DeterminateSystems/flake-checker-action@v8 | |
| - name: Show Nix info | |
| run: | | |
| nix --version | |
| nix flake show | |
| - name: Lint (clippy, deny warnings) | |
| run: nix develop .#ci -c cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Tests | |
| run: nix develop .#ci -c cargo test --all-features -- --nocapture | |
| - name: Build package | |
| run: | | |
| nix build .#default | |
| ./result/bin/conclaude --version | |
| verify-docs: | |
| name: Verify Generated Docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Nix | |
| uses: DeterminateSystems/nix-installer-action@v14 | |
| with: | |
| logger: pretty | |
| - name: Setup Magic Nix Cache | |
| uses: DeterminateSystems/magic-nix-cache-action@v8 | |
| - name: Generate documentation | |
| run: nix develop .#ci -c cargo run --bin generate-docs | |
| - name: Check for documentation changes | |
| run: | | |
| # Check for both modified and untracked files | |
| git add -N docs/src/content/docs/reference/config/ | |
| if ! git diff --exit-code docs/src/content/docs/reference/config/; then | |
| echo "[FAILED] Generated documentation is out of date!" | |
| echo "" | |
| echo "The configuration documentation needs to be regenerated." | |
| echo "Please run the following command locally and commit the changes:" | |
| echo "" | |
| echo " cargo run --bin generate-docs" | |
| echo "" | |
| echo "Changes detected:" | |
| git diff docs/src/content/docs/reference/config/ | |
| exit 1 | |
| else | |
| echo "[OK] Generated documentation is up to date!" | |
| fi | |
| spectr-validate: | |
| name: Spectr Validate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: spectr-action | |
| uses: connerohnesorge/spectr-action@v0.0.4 |