diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml new file mode 100644 index 000000000..6eb882795 --- /dev/null +++ b/.github/workflows/build-bindings.yml @@ -0,0 +1,23 @@ +# Purpose: We want to build the o1js bindings in CI so that people in the +# community can change them without being scared of breaking things, or +# needing to do the complicated (without nix) build setup. + +name: Build o1js bindings + +on: + pull_request: + +jobs: + nix-build: + name: build-bindings-ubuntu + runs-on: ubuntu-latest + steps: + - name: Disable smudging + run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v30 + - run: | + set -Eeu + export GIT_LFS_SKIP_SMUDGE=1 + ./pin.sh + nix develop o1js --command bash --command "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