diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 7a501b83e0..34c74d4d1c 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -4,6 +4,12 @@ description: 'All of the building steps for o1js' permissions: contents: write +inputs: + proof_systems_commit: + description: 'proof_systems commit to use' + required: false + default: '' + runs: using: "composite" steps: @@ -22,6 +28,16 @@ runs: with: node-version: '20' + - name: use proof_systems_commit if provided + if: ${{ inputs.proof_systems_commit != '' }} + shell: bash + run: | + git -C src/mina/src/lib/crypto/proof-systems fetch origin ${{ inputs.proof_systems_commit }} + git -C src/mina/src/lib/crypto/proof-systems clean -fdx + git -C src/mina/src/lib/crypto/proof-systems checkout ${{ inputs.proof_systems_commit }} + git -C src/mina/src/lib/crypto/proof-systems clean -fdx + git -C src/mina add src/lib/crypto/proof-systems + - name: cache bindings uses: actions/cache@v4 id: bindings-cache @@ -29,9 +45,9 @@ runs: path: | src/bindings/compiled src/bindings/mina-transaction/gen - key: bindings-${{ github.event.pull_request.head.sha || github.sha }} + key: bindings-${{ github.event.pull_request.head.sha || github.sha }}-${{ inputs.proof_systems_commit }} - name: Build the o1js bindings - if: steps.bindings-cache.outputs.cache-hit != 'true' + if: ${{ steps.bindings-cache.outputs.cache-hit != 'true' }} shell: bash run: | set -Eeu @@ -47,13 +63,13 @@ runs: dist key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.ts', '**/*.js') }} - name: Build examples - if: steps.cache.outputs.cache-hit != 'true' + if: ${{ steps.cache.outputs.cache-hit != 'true' }} shell: bash run: | npm ci npm run build:examples - name: Build o1js clean - if: steps.cache.outputs.cache-hit != 'true' + if: ${{ steps.cache.outputs.cache-hit != 'true' }} shell: bash run: | rm -fr dist diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6c345f9355..258fbb2e87 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -6,8 +6,26 @@ on: - develop - v1 - v3 - pull_request: - workflow_dispatch: {} + pull_request: {} + workflow_dispatch: + inputs: + proof_systems_commit: + description: 'proof_systems commit to use' + required: false + default: '' + workflow_call: + inputs: + proof_systems_commit: + description: 'proof_systems commit to use' + required: false + type: string + default: '' + target_repo: + required: false + type: string + target_ref: + required: false + type: string concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -24,8 +42,14 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive + repository: ${{ inputs.target_repo || github.repository }} + ref: ${{ inputs.target_ref || github.ref }} - name: Build uses: ./.github/actions/build + with: + repository: ${{ inputs.target_repo || github.repository }} + ref: ${{ inputs.target_ref || github.ref }} + proof_systems_commit: ${{ inputs.proof_systems_commit }} Lint-Format-and-TypoCheck: strategy: @@ -37,6 +61,9 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4 + with: + repository: ${{ inputs.target_repo || github.repository }} + ref: ${{ inputs.target_ref || github.ref }} - name: Setup Node.JS ${{ matrix.node }} uses: actions/setup-node@v4 with: @@ -81,12 +108,15 @@ jobs: Upload-bindings: name: upload bindings artifact + if: ${{ inputs.proof_systems_commit == '' }} needs: [Prepare] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: submodules: recursive + repository: ${{ inputs.target_repo || github.repository }} + ref: ${{ inputs.target_ref || github.ref }} - name: upload uses: ./.github/actions/upload with: @@ -117,9 +147,15 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive + repository: ${{ inputs.target_repo || github.repository }} + ref: ${{ inputs.target_ref || github.ref }} - name: build uses: ./.github/actions/build + with: + repository: ${{ inputs.target_repo || github.repository }} + ref: ${{ inputs.target_ref || github.ref }} + proof_systems_commit: ${{ inputs.proof_systems_commit }} - name: Prepare for tests run: touch profiling.md - name: Execute tests @@ -146,8 +182,14 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive + repository: ${{ inputs.target_repo || github.repository }} + ref: ${{ inputs.target_ref || github.ref }} - name: build uses: ./.github/actions/build + with: + repository: ${{ inputs.target_repo || github.repository }} + ref: ${{ inputs.target_ref || github.ref }} + proof_systems_commit: ${{ inputs.proof_systems_commit }} - name: Count tests id: count_tests run: | @@ -279,8 +321,15 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + repository: ${{ inputs.target_repo || github.repository }} + ref: ${{ inputs.target_ref || github.ref }} - name: build uses: ./.github/actions/build + with: + repository: ${{ inputs.target_repo || github.repository }} + ref: ${{ inputs.target_ref || github.ref }} + proof_systems_commit: ${{ inputs.proof_systems_commit }} - name: Use shared steps for live testing jobs uses: ./.github/actions/live-tests-shared with: @@ -307,8 +356,15 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + repository: ${{ inputs.target_repo || github.repository }} + ref: ${{ inputs.target_ref || github.ref }} - name: build uses: ./.github/actions/build + with: + repository: ${{ inputs.target_repo || github.repository }} + ref: ${{ inputs.target_ref || github.ref }} + proof_systems_commit: ${{ inputs.proof_systems_commit }} - name: Use shared steps for live testing jobs uses: ./.github/actions/live-tests-shared with: diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml index 4b018f8f53..d7d9385b2f 100644 --- a/.github/workflows/pull_requests.yml +++ b/.github/workflows/pull_requests.yml @@ -15,15 +15,20 @@ jobs: Check-npm-deps: name: Check npmDepsHash is correct - runs-on: [sdk-self-hosted-linux-amd64-build-system] + runs-on: ubuntu-latest steps: - - name: Set up Nix - run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV - name: Disable smudging run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV - uses: actions/checkout@v4 with: submodules: recursive + - uses: nixbuild/nix-quick-install-action@v30 + continue-on-error: true + with: + nix_conf: | + keep-env-derivations = true + keep-outputs = true + require-sigs = false - name: fix npmDepsHash run: | set -Eeu