From 1ff5c29caa97f74fab3b765b3faa9b497b1a32ed Mon Sep 17 00:00:00 2001 From: Matt Walker Date: Fri, 15 Nov 2024 10:33:17 -0500 Subject: [PATCH] ci/bindings: Finish up first pass --- .github/workflows/build-bindings.yml | 37 ++++++++++------------------ flake.lock | 25 +++++++++++++++++-- flake.nix | 4 ++- 3 files changed, 39 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml index d60195155..7ffc1a7cf 100644 --- a/.github/workflows/build-bindings.yml +++ b/.github/workflows/build-bindings.yml @@ -6,31 +6,20 @@ name: Build o1js bindings on: pull_request: - push: - -jobs: - nix-matrix: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v30 - - id: set-matrix - name: Generate Nix Matrix - run: | - set -Eeu - matrix="$(nix eval --json '.#githubActions.matrix')" - echo "matrix=$matrix" >> "$GITHUB_OUTPUT" +jobs: nix-build: - name: ${{ matrix.name }} (${{ matrix.system }}) - needs: nix-matrix - runs-on: ${{ matrix.os }} - strategy: - matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}} + name: build-bindings-ubuntu + runs-on: [sdk-self-hosted-linux-amd64-build-system] steps: + - name: Disable smudging + run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v30 - - run: ./pin.sh - - run: 'nix develop o1js --command bash --command "npm run build:bindings && npm run build:update-bindings"' + with: + submodules: recursive + - run: | + set -Eeu + # Until we restart the runner and the PATH gets updated from /etc/bash.bashrc + export PATH="$PATH":/nix/var/nix/profiles/default/bin + ./pin.sh + nix develop o1js --command bash -c "npm run build:update-bindings" diff --git a/flake.lock b/flake.lock index 79916af26..efab58dee 100644 --- a/flake.lock +++ b/flake.lock @@ -265,8 +265,8 @@ "utils": "utils" }, "locked": { - "lastModified": 1731611028, - "narHash": "sha256-sehBPO+H9mtShGb3KNhdDVHj0pogt/tmiL9tc2ICkaU=", + "lastModified": 1731681924, + "narHash": "sha256-RnTcGydbDBji5UDjcGzxui7+55JT0ZXdTNvuNOFXEkg=", "path": "src/mina", "type": "path" }, @@ -321,6 +321,26 @@ "type": "github" } }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729742964, + "narHash": "sha256-B4mzTcQ0FZHdpeWcpDYPERtyjJd/NIuaQ9+BV1h+MpA=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "e04df33f62cdcf93d73e9a04142464753a16db67", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nix-npm-buildPackage": { "inputs": { "nixpkgs": [ @@ -561,6 +581,7 @@ "dune-nix": "dune-nix", "flake-utils": "flake-utils", "mina": "mina", + "nix-github-actions": "nix-github-actions", "nixpkgs": "nixpkgs_3", "nixpkgs-mozilla": "nixpkgs-mozilla_2" } diff --git a/flake.nix b/flake.nix index 889fa5193..7e1b663df 100644 --- a/flake.nix +++ b/flake.nix @@ -12,8 +12,10 @@ dune-nix.inputs.nixpkgs.follows = "nixpkgs"; dune-nix.inputs.flake-utils.follows = "flake-utils"; flake-utils.url = "github:numtide/flake-utils"; + nix-github-actions.url = "github:nix-community/nix-github-actions"; + nix-github-actions.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = { self, nixpkgs, flake-utils, ... }@inputs: + outputs = { self, nixpkgs, nix-github-actions, flake-utils, ... }@inputs: flake-utils.lib.eachDefaultSystem (system: let pkgs= (nixpkgs.legacyPackages."${system}".extend