Skip to content

Fixed go nix

Fixed go nix #338

name: "build-scaffold-tauri-happ"
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches: [ main, main-0.3, main-0.4 ]
pull_request:
branches: [ main, main-0.3, main-0.4 ]
jobs:
build-scaffold-tauri-happ:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-13]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Extend space
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: ./.github/actions/extend-space
- name: Install nix
uses: cachix/install-nix-action@v27
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-24.05
- uses: cachix/cachix-action@v15
with:
name: holochain-ci
- uses: cachix/cachix-action@v15
with:
name: darksoil-studio
- name: Test scaffold-tauri-happ
if: ${{ matrix.os == 'ubuntu-latest' }} # in macos-latest, this fails with "no space left on device" error
run: |
cargo test -p scaffold-tauri-happ
sh ./crates/scaffold-tauri-happ/run_test.sh
- name: Cache scaffold-tauri-happ
if: github.event_name == 'pull_request' && github.base_ref == 'main'
env:
CACHIX_AUTH_TOKEN: "${{ secrets.DARKSOIL_CACHIX_AUTH_TOKEN }}"
run: |
cachix watch-exec darksoil-studio -- nix build --accept-flake-config -L .#scaffold-tauri-happ
cachix push darksoil-studio $(nix path-info --accept-flake-config .#scaffold-tauri-happ)
- name: Pin scaffold-tauri-happ
if: github.event_name != 'pull_request' && github.ref_name == 'main'
env:
CACHIX_AUTH_TOKEN: "${{ secrets.DARKSOIL_CACHIX_AUTH_TOKEN }}"
run: |
cachix watch-exec darksoil-studio -- nix build --no-update-lock-file --accept-flake-config -L .#scaffold-tauri-happ
cachix push darksoil-studio $(nix path-info --json --accept-flake-config --no-warn-dirty .#scaffold-tauri-happ | nix run nixpkgs#jq -- -r 'keys[0]')
cachix pin darksoil-studio scaffold-tauri-happ $(nix path-info --json --accept-flake-config --no-warn-dirty .#scaffold-tauri-happ | nix run nixpkgs#jq -- -r 'keys[0]')