ci: swap magic-nix-cache with cachix

Cachix doesn't have rate limit issues like GitHub Actions does and I'd
love to support the Nix community. Plus, I have experience with Cachix
before and they've been so great.
This commit is contained in:
Mitchell Hashimoto
2023-12-22 14:36:28 -08:00
parent 582a87aa1c
commit b222cf33bd
3 changed files with 24 additions and 55 deletions

View File

@ -10,28 +10,9 @@ jobs:
uses: cachix/install-nix-action@v24
with:
nix_path: nixpkgs=channel:nixos-unstable
# Use cache to minimize build times.
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- uses: cachix/cachix-action@v12
with:
diagnostic-endpoint: "" # disable telemetry
name: ghostty
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Check Zig cache hash
run: nix develop -c ./nix/build-support/check-zig-cache-hash.sh
#
# NOTE: Build is disabled until we resolve dependency build speeds.
# build:
# needs: check-zig-cache-hash
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Setup Nix
# uses: cachix/install-nix-action@v24
# with:
# nix_path: nixpkgs=channel:nixos-unstable
# - name: Setup Nix cache
# uses: DeterminateSystems/magic-nix-cache-action@main
# with:
# diagnostic-endpoint: "" # disable telemetry
# - name: Run build
# run: nix build .

View File

@ -47,12 +47,10 @@ jobs:
- uses: cachix/install-nix-action@v24
with:
nix_path: nixpkgs=channel:nixos-unstable
# Use cache to minimize build times.
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- uses: cachix/cachix-action@v12
with:
diagnostic-endpoint: "" # disable telemetry
name: ghostty
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
# Setup Sparkle
- name: Setup Sparkle

View File

@ -30,12 +30,10 @@ jobs:
- uses: cachix/install-nix-action@v24
with:
nix_path: nixpkgs=channel:nixos-unstable
# Use cache to minimize build times.
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- uses: cachix/cachix-action@v12
with:
diagnostic-endpoint: "" # disable telemetry
name: ghostty
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
# Cross-compile the binary. We always use static building for this
# because its the only way to access the headers.
@ -56,12 +54,10 @@ jobs:
- uses: cachix/install-nix-action@v24
with:
nix_path: nixpkgs=channel:nixos-unstable
# Use cache to minimize build times.
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- uses: cachix/cachix-action@v12
with:
diagnostic-endpoint: "" # disable telemetry
name: ghostty
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Test NixOS package build
run: nix build .#ghostty
@ -80,12 +76,10 @@ jobs:
- uses: cachix/install-nix-action@v24
with:
nix_path: nixpkgs=channel:nixos-unstable
# Use cache to minimize build times.
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- uses: cachix/cachix-action@v12
with:
diagnostic-endpoint: "" # disable telemetry
name: ghostty
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
# GhosttyKit is the framework that is built from Zig for our native
# Mac app to access.
@ -162,12 +156,10 @@ jobs:
- uses: cachix/install-nix-action@v24
with:
nix_path: nixpkgs=channel:nixos-unstable
# Use cache to minimize build times.
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- uses: cachix/cachix-action@v12
with:
diagnostic-endpoint: "" # disable telemetry
name: ghostty
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: test
run: nix develop -c zig build -Dapp-runtime=none test
@ -188,11 +180,10 @@ jobs:
- uses: cachix/install-nix-action@v24
with:
nix_path: nixpkgs=channel:nixos-unstable
# Use cache to minimize build times.
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- uses: cachix/cachix-action@v12
with:
diagnostic-endpoint: "" # disable telemetry
name: ghostty
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: prettier check
run: nix develop -c prettier --check .
@ -203,10 +194,9 @@ jobs:
- uses: cachix/install-nix-action@v24
with:
nix_path: nixpkgs=channel:nixos-unstable
# Use cache to minimize build times.
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- uses: cachix/cachix-action@v12
with:
diagnostic-endpoint: "" # disable telemetry
name: ghostty
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: alejandra check
run: nix develop -c alejandra --check .