Skip to content

feat(doc): collect fragment IDs into index.json #748

feat(doc): collect fragment IDs into index.json

feat(doc): collect fragment IDs into index.json #748

Workflow file for this run

name: Test
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true
permissions: {} # No GITHUB_TOKEN permissions, as we only use it to increase API limit.
env:
CONTENT_ROOT: ${{ github.workspace }}/content/files
CONTENT_TRANSLATED_ROOT: ${{ github.workspace }}/translated-content/files
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
outputs:
rari-binary-artifact-id: ${{ steps.upload.outputs.artifact-id }}
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@9a1d20035bdbcbc899baabe1e402e85bc33639bc # 1.90
- name: sccache-cache
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
- name: Build
run: cargo build --release --verbose
- name: Upload binary
id: upload
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: rari-binary
path: target/release/rari
retention-days: 1
format:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@9a1d20035bdbcbc899baabe1e402e85bc33639bc # 1.90
with:
components: rustfmt
- name: Run fmt
run: cargo fmt -- --check
test:
needs: build
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@9a1d20035bdbcbc899baabe1e402e85bc33639bc # 1.90
- name: sccache-cache
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
- name: Run tests
run: cargo test --verbose --workspace --all-targets --no-fail-fast
- name: Run doc tests
run: cargo test --verbose --workspace --doc --features doctest --no-fail-fast
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@9a1d20035bdbcbc899baabe1e402e85bc33639bc # 1.90
with:
components: clippy
- name: Run clippy
run: cargo clippy --all-features --workspace -- -Dwarnings
content:
if: github.event_name == 'pull_request'
needs: build
uses: ./.github/workflows/_test-content.yml
with:
rari-binary-artifact-id: ${{ needs.build.outputs.rari-binary-artifact-id }}
pr-review:
if: github.event_name == 'pull_request'
needs: build
permissions:
contents: read
id-token: write
pull-requests: write
secrets: inherit
uses: ./.github/workflows/pr-review-companion.yml
with:
rari-binary-artifact-id: ${{ needs.build.outputs.rari-binary-artifact-id }}