feat: add a Linux CI job alongside macOS, in one shared workflow
Renamed macos.yml to ci.yml with two jobs (macos, linux) under one push/PR/dispatch trigger, so both run from the same commit instead of needing separate files. Cache keys are now OS-prefixed (cargo-macos-/ cargo-linux-): target/ artifacts are platform-specific and would otherwise collide under a shared key.
This commit is contained in:
parent
15fdbe4dbd
commit
d85427156e
1 changed files with 31 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
name: macOS
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
@ -7,7 +7,7 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
macos:
|
||||||
runs-on: macos-arm64
|
runs-on: macos-arm64
|
||||||
steps:
|
steps:
|
||||||
- uses: https://code.forgejo.org/actions/checkout@v4
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
||||||
|
|
@ -21,14 +21,17 @@ jobs:
|
||||||
repository: randogoth/fumi
|
repository: randogoth/fumi
|
||||||
ref: main
|
ref: main
|
||||||
path: fumi
|
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
|
- uses: https://code.forgejo.org/actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo/registry
|
~/.cargo/registry
|
||||||
carrier/target
|
carrier/target
|
||||||
fumi/target
|
fumi/target
|
||||||
key: cargo-${{ hashFiles('carrier/Cargo.lock') }}
|
key: cargo-macos-${{ hashFiles('carrier/Cargo.lock') }}
|
||||||
restore-keys: cargo-
|
restore-keys: cargo-macos-
|
||||||
# Forgejo auto-injects GITHUB_TOKEN (GH Actions compatibility), scoped
|
# Forgejo auto-injects GITHUB_TOKEN (GH Actions compatibility), scoped
|
||||||
# to this Forgejo instance. Nix auto-detects that env var and assumes
|
# 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
|
# it's a github.com credential, so it sends it to api.github.com when
|
||||||
|
|
@ -39,3 +42,27 @@ jobs:
|
||||||
working-directory: carrier
|
working-directory: carrier
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ""
|
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: ""
|
||||||
Loading…
Add table
Add a link
Reference in a new issue