Image backgrounds #2970
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: Gosub Continuous Integration (CI) | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| # Cancel superseded runs: without this, every push to a PR leaves the previous | |
| # full CI run burning runners to completion alongside the new one. | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| env: | |
| CARGO_TERM_COLOR: always | |
| # No debuginfo in CI: not needed for pass/fail, and it roughly halves both | |
| # cold-build time and cache size for the big dep graphs (skia, vello, gtk). | |
| CARGO_PROFILE_DEV_DEBUG: 0 | |
| CARGO_PROFILE_TEST_DEBUG: 0 | |
| jobs: | |
| test: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| rust_version: [ stable, nightly, 1.82.0 ] | |
| # rust_version: [ stable, beta, nightly, 1.73.0, "stable minus 1 release", "stable minus 2 releases" ] | |
| # os: [ ubuntu-24.04, windows-latest, macos-latest ] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust_version }} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| # Key must be unique per job: caches are immutable per key, so if | |
| # jobs share one, whichever finishes first on main saves its (possibly | |
| # artifact-less) cache and the others rebuild from scratch on every PR. | |
| shared-key: test-${{ matrix.rust_version }} | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: Install dependencies | |
| run: sudo apt update -y && sudo apt install sqlite3 libsqlite3-dev libglib2.0-dev libcairo2-dev libgdk-pixbuf-2.0-dev libpango1.0-dev libgtk-4-dev -y | |
| - uses: taiki-e/install-action@nextest | |
| - name: Build and test | |
| run: cargo nextest run --locked --all --no-fail-fast | |
| - name: Doctests | |
| run: cargo test --doc --locked --all | |
| clippy: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| rust_version: [ stable, nightly ] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust_version }} | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: clippy-${{ matrix.rust_version }} | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: Install dependencies | |
| run: sudo apt update -y && sudo apt install sqlite3 libsqlite3-dev libglib2.0-dev libcairo2-dev libgdk-pixbuf-2.0-dev libpango1.0-dev libgtk-4-dev -y | |
| - name: Run Clippy | |
| run: cargo clippy --locked --all --all-targets -- -D warnings | |
| check-features: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| # Separate cache: all-features artifacts (skia, vello, gtk) differ | |
| # heavily from the default-features builds of the other jobs. | |
| shared-key: all-features | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: Install dependencies | |
| run: sudo apt update -y && sudo apt install sqlite3 libsqlite3-dev libglib2.0-dev libcairo2-dev libgdk-pixbuf-2.0-dev libpango1.0-dev libgtk-4-dev -y | |
| - uses: taiki-e/install-action@nextest | |
| - name: Clippy with all features | |
| run: cargo clippy --locked --all --all-targets --all-features -- -D warnings | |
| - name: Test with all features | |
| run: cargo nextest run --locked --all --all-features --no-fail-fast | |
| fmt: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| # No rust-cache here: cargo fmt compiles nothing, and saving a cache from | |
| # this job would poison the key it shares with compiling jobs. | |
| - name: Run fmt | |
| run: cargo fmt --check --all | |
| deny: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check |