Every Rust job restores the stable toolchain, Cargo registry and its own target directories from the runner cache. Keys combine the ISO week and all Cargo.lock files, so dependencies are reused across pushes while stale build output and old toolchains expire weekly. Release jobs keep separate entries per plugin.
92 lines
3.0 KiB
YAML
92 lines
3.0 KiB
YAML
name: Check and Windows preview
|
|
on:
|
|
push:
|
|
branches: ["**"]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
CARGO_HOME: ${{ gitea.workspace }}/.cargo-ci
|
|
RUSTUP_HOME: ${{ gitea.workspace }}/.rustup-ci
|
|
CARGO_TERM_COLOR: always
|
|
# Incremental data is not reused between CI runs; it only inflates the cache.
|
|
CARGO_INCREMENTAL: "0"
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
container: node:22-bookworm
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
plugin: [rivet, patina]
|
|
steps:
|
|
- uses: https://github.com/actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
persist-credentials: false
|
|
- uses: ./.gitea/actions/setup
|
|
with:
|
|
cache-name: check-${{ matrix.plugin }}
|
|
target-paths: |
|
|
target
|
|
plugins/${{ matrix.plugin }}/plugin/target
|
|
- run: python3 -m unittest discover -s scripts/tests -v
|
|
- run: python3 scripts/check-plugin.py --plugin "${{ matrix.plugin }}"
|
|
|
|
previews:
|
|
runs-on: ubuntu-latest
|
|
container: node:22-bookworm
|
|
steps:
|
|
- uses: https://github.com/actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
persist-credentials: false
|
|
- uses: ./.gitea/actions/setup
|
|
with:
|
|
cache-name: previews
|
|
target-paths: tools/editor-check/target
|
|
- run: |
|
|
cargo fmt --all -- --check
|
|
cargo fmt --manifest-path tools/editor-check/Cargo.toml -- --check
|
|
mkdir -p target/editor
|
|
cargo run --manifest-path tools/editor-check/Cargo.toml --locked -- target/editor/rivet.png --plugin rivet
|
|
cargo run --manifest-path tools/editor-check/Cargo.toml --locked -- target/editor/patina.png --plugin patina
|
|
cargo run --manifest-path tools/editor-check/Cargo.toml --locked -- target/editor/patina-compact.png --plugin patina --compact
|
|
- uses: https://github.com/actions/upload-artifact@v3-node20
|
|
with:
|
|
name: editor-previews
|
|
path: target/editor/*.png
|
|
retention-days: 7
|
|
|
|
windows:
|
|
needs: [check, previews]
|
|
runs-on: ubuntu-latest
|
|
container: node:22-bookworm
|
|
env:
|
|
CARGO_TARGET_DIR: ${{ gitea.workspace }}/target/windows
|
|
steps:
|
|
- uses: https://github.com/actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
persist-credentials: false
|
|
- uses: ./.gitea/actions/setup
|
|
with:
|
|
windows: "true"
|
|
cache-name: windows-preview
|
|
target-paths: target/windows
|
|
- run: |
|
|
python3 scripts/build-plugin.py --plugin rivet --target x86_64-pc-windows-gnu
|
|
python3 scripts/build-plugin.py --plugin patina --target x86_64-pc-windows-gnu
|
|
python3 scripts/package-windows.py
|
|
- uses: https://github.com/actions/upload-artifact@v3-node20
|
|
with:
|
|
name: rivet-patina-windows-x86_64
|
|
path: |
|
|
dist/rivet-patina-windows-x86_64.zip
|
|
dist/rivet-patina-windows-x86_64.zip.sha256
|
|
retention-days: 30
|