Fixed crane #526
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "build-scaffold-holochain-runtime" | |
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-holochain-runtime: | |
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-holochain-runtime | |
if: ${{ matrix.os == 'ubuntu-latest' }} # in macos-latest, this fails with "no space left on device" error | |
run: | | |
cargo test -p scaffold-holochain-runtime | |
sh ./crates/scaffold-holochain-runtime/run_test.sh | |
- name: Cache scaffold-holochain-runtime | |
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 --no-update-lock-file --accept-flake-config -L .#scaffold-holochain-runtime | |
cachix push darksoil-studio $(nix path-info --json --accept-flake-config --no-warn-dirty .#scaffold-holochain-runtime | nix run nixpkgs#jq -- -r 'keys[0]') | |
- name: Pin scaffold-holochain-runtime | |
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 --accept-flake-config -L .#scaffold-holochain-runtime | |
cachix push darksoil-studio $(nix path-info --json --accept-flake-config --no-warn-dirty .#scaffold-holochain-runtime | nix run nixpkgs#jq -- -r 'keys[0]') | |
cachix pin darksoil-studio scaffold-holochain-runtime $(nix path-info --json --accept-flake-config --no-warn-dirty .#scaffold-holochain-runtime | nix run nixpkgs#jq -- -r 'keys[0]') | |