ci: cache zig local/global cache

This commit is contained in:
Mitchell Hashimoto
2024-02-29 11:35:51 -08:00
parent 8881cd6373
commit 4093b9e707
2 changed files with 65 additions and 26 deletions

View File

@ -3,13 +3,18 @@ name: Nix
jobs: jobs:
check-zig-cache-hash: check-zig-cache-hash:
runs-on: namespace-profile-ghostty-sm runs-on: namespace-profile-ghostty-sm
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Nix Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.1.2 uses: namespacelabs/nscloud-cache-action@v1.1.2
with: with:
path: /nix path: |
/nix
/zig
- name: Setup Nix - name: Setup Nix
uses: cachix/install-nix-action@v24 uses: cachix/install-nix-action@v24
with: with:

View File

@ -20,17 +20,20 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
needs: test needs: test
env: env:
# Needed for macos SDK ZIG_LOCAL_CACHE_DIR: /zig/local-cache
AGREE: "true" ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
# Install Nix and use that to run our tests so our environment matches exactly. - name: Setup Cache
- name: Setup Nix Cache
uses: namespacelabs/nscloud-cache-action@v1.1.2 uses: namespacelabs/nscloud-cache-action@v1.1.2
with: with:
path: /nix path: |
/nix
/zig
# Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v24 - uses: cachix/install-nix-action@v24
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
@ -48,15 +51,21 @@ jobs:
# We build benchmarks on large because it uses ReleaseFast # We build benchmarks on large because it uses ReleaseFast
runs-on: namespace-profile-ghostty-lg runs-on: namespace-profile-ghostty-lg
needs: test needs: test
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
# Install Nix and use that to run our tests so our environment matches exactly. - name: Setup Cache
- name: Setup Nix Cache
uses: namespacelabs/nscloud-cache-action@v1.1.2 uses: namespacelabs/nscloud-cache-action@v1.1.2
with: with:
path: /nix path: |
/nix
/zig
# Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v24 - uses: cachix/install-nix-action@v24
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
@ -71,15 +80,21 @@ jobs:
build-linux-libghostty: build-linux-libghostty:
runs-on: namespace-profile-ghostty-md runs-on: namespace-profile-ghostty-md
needs: test needs: test
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
# Install Nix and use that to run our tests so our environment matches exactly. - name: Setup Cache
- name: Setup Nix Cache
uses: namespacelabs/nscloud-cache-action@v1.1.2 uses: namespacelabs/nscloud-cache-action@v1.1.2
with: with:
path: /nix path: |
/nix
/zig
# Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v24 - uses: cachix/install-nix-action@v24
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
@ -98,15 +113,21 @@ jobs:
os: [namespace-profile-ghostty-md, namespace-profile-ghostty-md-arm64] os: [namespace-profile-ghostty-md, namespace-profile-ghostty-md-arm64]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
needs: test needs: test
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
# Install Nix and use that to run our tests so our environment matches exactly. - name: Setup Cache
- name: Setup Nix Cache
uses: namespacelabs/nscloud-cache-action@v1.1.2 uses: namespacelabs/nscloud-cache-action@v1.1.2
with: with:
path: /nix path: |
/nix
/zig
# Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v24 - uses: cachix/install-nix-action@v24
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
@ -121,9 +142,6 @@ jobs:
build-macos: build-macos:
runs-on: namespace-profile-ghostty-macos runs-on: namespace-profile-ghostty-macos
needs: test needs: test
env:
# Needed for macos SDK
AGREE: "true"
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -224,15 +242,21 @@ jobs:
test: test:
runs-on: namespace-profile-ghostty-md runs-on: namespace-profile-ghostty-md
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
# Install Nix and use that to run our tests so our environment matches exactly. - name: Setup Cache
- name: Setup Nix Cache
uses: namespacelabs/nscloud-cache-action@v1.1.2 uses: namespacelabs/nscloud-cache-action@v1.1.2
with: with:
path: /nix path: |
/nix
/zig
# Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v24 - uses: cachix/install-nix-action@v24
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
@ -256,12 +280,17 @@ jobs:
prettier: prettier:
runs-on: namespace-profile-ghostty-sm runs-on: namespace-profile-ghostty-sm
timeout-minutes: 60 timeout-minutes: 60
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps: steps:
- uses: actions/checkout@v4 # Check out repo so we can lint it - uses: actions/checkout@v4 # Check out repo so we can lint it
- name: Setup Nix Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.1.2 uses: namespacelabs/nscloud-cache-action@v1.1.2
with: with:
path: /nix path: |
/nix
/zig
- uses: cachix/install-nix-action@v24 - uses: cachix/install-nix-action@v24
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
@ -277,12 +306,17 @@ jobs:
alejandra: alejandra:
runs-on: namespace-profile-ghostty-sm runs-on: namespace-profile-ghostty-sm
timeout-minutes: 60 timeout-minutes: 60
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps: steps:
- uses: actions/checkout@v4 # Check out repo so we can lint it - uses: actions/checkout@v4 # Check out repo so we can lint it
- name: Setup Nix Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.1.2 uses: namespacelabs/nscloud-cache-action@v1.1.2
with: with:
path: /nix path: |
/nix
/zig
- uses: cachix/install-nix-action@v24 - uses: cachix/install-nix-action@v24
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable