From f2c4434c9e3606f7e1ed5c92c44d9601c318c74d Mon Sep 17 00:00:00 2001 From: Anton Baliasnikov Date: Mon, 13 Jan 2025 13:21:17 +0000 Subject: [PATCH] test --- .github/actions/build/action.yml | 13 +++- .github/workflows/check-tooling.yaml | 91 +++++++++++++++++++++------- 2 files changed, 80 insertions(+), 24 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 0f6aeca2..64ff8eb7 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -21,6 +21,14 @@ inputs: description: 'Enable code coverage.' required: false default: 'false' +outputs: + zksolc-artifact-id: + description: "Artifact ID of the built zksolc." + value: ${{ steps.upload-binary.outputs.artifact-id }} + zksolc-artifact-url: + description: "Artifact URL of the built zksolc." + value: ${{ steps.upload-binary.outputs.artifact-url }} + runs: using: "composite" @@ -57,11 +65,12 @@ runs: run: | mkdir -p ./releases/${{ inputs.release-suffix }} [ "$RUNNER_OS" = "Windows" ] && WIN_SUFFIX=".exe" - strip "./target/${{ matrix.target }}/${{ inputs.build-type }}/zksolc${WIN_SUFFIX}" - mv "./target/${{ matrix.target }}/${{ inputs.build-type }}/zksolc${WIN_SUFFIX}" \ + strip "./target/${{ inputs.target }}/${{ inputs.build-type }}/zksolc${WIN_SUFFIX}" + mv "./target/${{ inputs.target }}/${{ inputs.build-type }}/zksolc${WIN_SUFFIX}" \ "./releases/${{ inputs.release-suffix }}/zksolc-${{ inputs.release-suffix }}${WIN_SUFFIX}" - name: Upload binary + id: upload-binary if: inputs.release-suffix != '' uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/check-tooling.yaml b/.github/workflows/check-tooling.yaml index 05d0e0fd..8be22a85 100644 --- a/.github/workflows/check-tooling.yaml +++ b/.github/workflows/check-tooling.yaml @@ -1,38 +1,85 @@ -name: Check hardhat and foundry +name: Check tooling on: workflow_dispatch: inputs: zksolc-version: - description: "Release version of zksolc." - required: true + description: "Tag or branch of zksolc version to test vs tooling. If empty, the workflow branch is used." + required: false + default: '' type: string + # Test with each merge to main + push: + branches: + - main pull_request: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true + jobs: -# check-hardhat: -# runs-on: ubuntu-latest -# steps: -# - uses: convictional/trigger-workflow-and-wait@v1.6.1 -# with: -# owner: matter-labs -# repo: zksync-ci-stand -# workflow_file_name: hardhat.yaml -# github_token: ${{ secrets.ZKSYNC_DISPATCH_TOKEN }} -# wait_interval: 30 -# client_payload: '{ "zksolc-version": "${{ inputs.zksolc-version || github.ref }}" }' -# propagate_failure: true -# trigger_workflow: true -# wait_workflow: true + build-zksolc: + if: inputs.zksolc-version == '' + name: Build zksolc + runs-on: matterlabs-ci-runner-high-performance + container: + image: ghcr.io/matter-labs/zksync-llvm-runner:latest + outputs: + zksolc-artifact-id: ${{ steps.build-zksolc.outputs.artifact-id }} + steps: + - name: Checkout source + uses: actions/checkout@v4 + with: + ref: ${{ inputs.zksolc-version || '' }} + + - name: Build LLVM + uses: matter-labs/era-compiler-ci/.github/actions/build-llvm@v1 + with: + target-env: 'gnu' + enable-assertions: 'false' + build-type: Release + ccache-key: ${{ format('llvm-{0}-{1}-{2}', runner.os, runner.arch, 'gnu') }} + save-ccache: 'false' + + - name: Build zksolc + id: build-zksolc + uses: ./.github/actions/build + with: + target: 'x86_64-unknown-linux-gnu' + release-suffix: 'test-tooling' + + + # Check Hardhat with built zksolc + check-hardhat: + needs: build-zksolc + uses: matter-labs/zksync-ci-common/.github/workflows/check-hardhat.yaml@v1 + secrets: inherit + with: + zksolc-release-suffix: 'test-tooling' + + # Check Foundry with built zksolc check-foundry: - uses: matter-labs/zksync-ci-stand/.github/workflows/foundry.yaml@main - secrets: - inherit: true + needs: build-zksolc + uses: matter-labs/zksync-ci-common/.github/workflows/check-foundry.yaml@v1 + secrets: inherit + with: + zksolc-release-suffix: 'test-tooling' + + # Check Hardhat with a specific released zksolc version + check-hardhat-release: + if: inputs.zksolc-version != '' + uses: matter-labs/zksync-ci-common/.github/workflows/check-hardhat.yaml@v1 + secrets: inherit + with: + zksolc-version: ${{ inputs.zksolc-version }} + + # Check Foundry with a specific released zksolc version + check-foundry-release: + if: inputs.zksolc-version != '' + uses: matter-labs/zksync-ci-common/.github/workflows/check-foundry.yaml@v1 + secrets: inherit with: - zksolc-version: '1.5.9' - # zksolc-version: ${{ inputs.zksolc-version || github.ref }} + zksolc-version: ${{ inputs.zksolc-version }}