Repository navigation
Serialize model cache downloads and removals #17
Workflow file for this run
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 | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["v*"] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CARGO_INCREMENTAL: 0 | |
| jobs: | |
| check: | |
| name: check | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clang libclang-dev cmake pkg-config | |
| - run: cargo fmt --all -- --check | |
| - run: cargo clippy --locked --all-targets --all-features -- -D warnings | |
| - run: cargo test --locked --all-targets --all-features | |
| - name: cli smoke | |
| run: | | |
| cargo run --locked --quiet -- --version | |
| cargo run --locked --quiet -- --doctor || test $? -eq 1 | |
| cargo run --locked --quiet -- --help >/dev/null | |
| msrv: | |
| name: msrv (1.90) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: "1.90.0" | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clang libclang-dev cmake pkg-config | |
| - run: cargo check --locked --all-targets | |
| release: | |
| name: release (${{ matrix.target }}) | |
| needs: check | |
| if: github.ref_type == 'tag' | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 45 | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| binary: scribe | |
| asset: scribe-linux-x86_64 | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| binary: scribe | |
| asset: scribe-macos-aarch64 | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| binary: scribe.exe | |
| asset: scribe-windows-x86_64.exe | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - uses: Swatinem/rust-cache@v2 | |
| - if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clang libclang-dev cmake pkg-config | |
| - run: cargo build --locked --release --target ${{ matrix.target }} | |
| - shell: bash | |
| run: | | |
| mkdir -p dist | |
| cp "target/${{ matrix.target }}/release/${{ matrix.binary }}" "dist/${{ matrix.asset }}" | |
| test -s "dist/${{ matrix.asset }}" | |
| "target/${{ matrix.target }}/release/${{ matrix.binary }}" --version | |
| - name: checksums | |
| shell: bash | |
| run: | | |
| cd dist | |
| if command -v sha256sum >/dev/null 2>&1; then | |
| sha256sum "${{ matrix.asset }}" > SHA256SUMS | |
| else | |
| shasum -a 256 "${{ matrix.asset }}" > SHA256SUMS | |
| fi | |
| # each target uploads its own binary. no generated notes, no body edits: | |
| # three matrix jobs appending notes gave us three changelog links. | |
| - uses: softprops/action-gh-release@v3 | |
| with: | |
| files: dist/* | |
| generate_release_notes: false | |
| fail_on_unmatched_files: true |