95 lines
3.2 KiB
YAML
95 lines
3.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
macos:
|
|
runs-on: macos-arm64
|
|
steps:
|
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
|
with:
|
|
path: carrier
|
|
# Cargo.toml depends on fumi-core via a relative sibling path
|
|
# (../fumi/core), matching how it's checked out locally. Fetched as
|
|
# its own sibling checkout here so that path resolves the same way.
|
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
|
with:
|
|
repository: randogoth/fumi
|
|
ref: main
|
|
path: fumi
|
|
# Cache key includes the OS explicitly: target/ artifacts are
|
|
# platform-specific, so macOS and Linux must never share a cache key
|
|
# or they'd clobber each other's compiled objects.
|
|
- uses: https://code.forgejo.org/actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
carrier/target
|
|
fumi/target
|
|
key: cargo-macos-${{ hashFiles('carrier/Cargo.lock') }}
|
|
restore-keys: cargo-macos-
|
|
# Forgejo auto-injects GITHUB_TOKEN (GH Actions compatibility), scoped
|
|
# to this Forgejo instance. Nix auto-detects that env var and assumes
|
|
# it's a github.com credential, so it sends it to api.github.com when
|
|
# fetching nixpkgs tarballs for devbox - which rejects it with 401.
|
|
# Clearing it here falls back to unauthenticated (fine for public
|
|
# nixpkgs fetches, same as this succeeds locally with no token set).
|
|
- run: devbox run check
|
|
working-directory: carrier
|
|
env:
|
|
GITHUB_TOKEN: ""
|
|
|
|
linux:
|
|
runs-on: linux-x86_64
|
|
steps:
|
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
|
with:
|
|
path: carrier
|
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
|
with:
|
|
repository: randogoth/fumi
|
|
ref: main
|
|
path: fumi
|
|
- uses: https://code.forgejo.org/actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
carrier/target
|
|
fumi/target
|
|
key: cargo-linux-${{ hashFiles('carrier/Cargo.lock') }}
|
|
restore-keys: cargo-linux-
|
|
- run: devbox run check
|
|
working-directory: carrier
|
|
env:
|
|
GITHUB_TOKEN: ""
|
|
|
|
windows:
|
|
runs-on: windows-x86_64
|
|
steps:
|
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
|
with:
|
|
path: carrier
|
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
|
with:
|
|
repository: randogoth/fumi
|
|
ref: main
|
|
path: fumi
|
|
- uses: https://code.forgejo.org/actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
carrier/target
|
|
fumi/target
|
|
key: cargo-windows-${{ hashFiles('carrier/Cargo.lock') }}
|
|
restore-keys: cargo-windows-
|
|
# No devbox on Windows: the runner host itself is the MSYS2 MINGW64
|
|
# toolchain that windows/setup.sh installs, so this runs the same
|
|
# commands devbox's `check` script runs on the other two platforms
|
|
# straight from cargo.
|
|
- run: cargo fmt --check && cargo build && cargo test
|
|
working-directory: carrier
|
|
shell: bash
|