From b914dfdeb4edcd0eda2f5c2e99c1d125628780d2 Mon Sep 17 00:00:00 2001 From: x-mass <36629999+x-mass@users.noreply.github.com> Date: Wed, 17 Jan 2024 14:53:04 +0000 Subject: [PATCH] Fix GH Actions build --- .../composite-install-dependecies/action.yml | 8 ++++ .github/workflows/pull_request.yml | 39 +++++++++++-------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/.github/actions/composite-install-dependecies/action.yml b/.github/actions/composite-install-dependecies/action.yml index 540ca3e0..3c7b74be 100644 --- a/.github/actions/composite-install-dependecies/action.yml +++ b/.github/actions/composite-install-dependecies/action.yml @@ -3,6 +3,14 @@ description: 'Installs required dependencies for the build' runs: using: "composite" steps: + - name: Ensure sudo is installed + shell: bash + run: | + if ! command -v sudo &>/dev/null; then + apt-get update + apt-get install -y sudo + fi + - name: Update and install dependencies shell: bash run: | diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index e86cf963..f6d60b1f 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -44,6 +44,8 @@ jobs: prepare-targets: name: Prepare targets strings runs-on: ubuntu-22.04 + if: | + always() && !cancelled() outputs: evm-targets: ${{ steps.get-targets.outputs.evm-targets }} prover-targets: ${{ steps.get-targets.outputs.prover-targets }} @@ -65,6 +67,9 @@ jobs: name: Get zkLLVM run to use artifacts from needs: - handle-syncwith + if: | + always() && !cancelled() && + (needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped') runs-on: ubuntu-22.04 outputs: run-id: ${{ steps.get-run-id.outputs.run-id }} @@ -127,10 +132,16 @@ jobs: build-and-generate-proofs: name: Build prover, generate proofs for circuits runs-on: ubuntu-22.04 + container: ubuntu:jammy-20240111 needs: - handle-syncwith - get-zkllvm-run - prepare-targets + if: | + always() && !cancelled() && + (needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped') && + (needs.get-zkllvm-run.result == 'success' || needs.get-zkllvm-run.result == 'skipped') && + (needs.prepare-targets.result == 'success' || needs.prepare-targets.result == 'skipped') strategy: matrix: cpp-compiler: [ g++, clang++ ] @@ -140,6 +151,12 @@ jobs: artifact-name: ${{ steps.artifact-name.outputs.merged }} steps: + - name: Install basics for Ubuntu container + # Checkout action inside container needs git tool + run: | + apt-get update + apt-get install git lsb-release coreutils -y + - name: Checkout proof-producer uses: actions/checkout@v4 with: @@ -149,13 +166,6 @@ jobs: - name: Install dependencies uses: ./.github/actions/composite-install-dependecies - - name: Install fixes to GH worker - run: | - # https://github.com/actions/runner-images/issues/8659#issuecomment-1853177960 - sudo apt-get install --allow-downgrades \ - libstdc++6=12.3.0-1ubuntu1~22.04 \ - libgcc-s1=12.3.0-1ubuntu1~22.04 - - name: Print toolchain information run: | git --version @@ -179,15 +189,7 @@ jobs: echo "dependencies-dir=${{ github.workspace }}/../dependencies" >> $GITHUB_OUTPUT echo "artifact-dir=$(realpath ${{ github.workspace }}/../artifacts)" >> $GITHUB_OUTPUT - # Get platform version - if [[ ${{ runner.os }} == 'Linux' ]]; then - platform_version=$(lsb_release -rs) - proc_number=$(nproc) - elif [[ ${{ runner.os }} == 'macOS' ]]; then - platform_version=$(sw_vers -productVersion) - proc_number=$(sysctl -n hw.logicalcpu) - fi - echo "platform-version=${platform_version}" >> $GITHUB_OUTPUT + echo "platform-version=$(lsb_release -rs)" >> $GITHUB_OUTPUT - name: Download circuits and assignments artifact uses: dawidd6/action-download-artifact@v3 @@ -291,6 +293,11 @@ jobs: - handle-syncwith - build-and-generate-proofs - prepare-targets + if: | + always() && !cancelled() && + (needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped') && + (needs.build-and-generate-proofs.result == 'success' || needs.build-and-generate-proofs.result == 'skipped') && + (needs.prepare-targets.result == 'success' || needs.prepare-targets.result == 'skipped') uses: NilFoundation/evm-placeholder-verification/.github/workflows/reusable-verify-proofs.yml@5bb7c4b0790f56b3a339e33ba442816fac17ab88 with: artifact-name: ${{ needs.build-and-generate-proofs.outputs.artifact-name }}