Skip to content

Commit

Permalink
Fix GH Actions build
Browse files Browse the repository at this point in the history
  • Loading branch information
x-mass committed Jan 17, 2024
1 parent b51e128 commit 8592a81
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 23 deletions.
8 changes: 8 additions & 0 deletions .github/actions/composite-install-dependecies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
60 changes: 37 additions & 23 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down Expand Up @@ -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++ ]
Expand All @@ -140,6 +151,14 @@ jobs:
artifact-name: ${{ steps.artifact-name.outputs.merged }}

steps:
# It takes centuries GH developers to fix bugs (https://github.com/actions/runner/issues/2058),
# that's why we use `/__w/proof-producer/proof-producer` instead of ${{ github.workspace }}
- 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:
Expand All @@ -149,45 +168,35 @@ 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
cc --version
cmake --version
- name: Debug TODO remove
run: |
cd /__w/proof-producer/proof-producer
/usr/bin/git config --get remote.origin.url
- name: Checkout modules to specified refs
if: ${{ needs.handle-syncwith.outputs.prs-refs }} != ''
uses: NilFoundation/ci-cd/actions/[email protected]
with:
paths: |
${{ github.workspace }}/**
!${{ github.workspace }}/**/.git/**
/__w/proof-producer/proof-producer/**
!/__w/proof-producer/proof-producer/**/.git/**
refs: ${{ needs.handle-syncwith.outputs.prs-refs }}

- name: Set usefull strings
id: strings
shell: bash
run: |
echo "build-dir=${{ github.workspace }}/build" >> $GITHUB_OUTPUT
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 "build-dir=/__w/proof-producer/proof-producer/build" >> $GITHUB_OUTPUT
echo "dependencies-dir=/__w/proof-producer/proof-producer/../dependencies" >> $GITHUB_OUTPUT
echo "artifact-dir=$(realpath /__w/proof-producer/proof-producer/../artifacts)" >> $GITHUB_OUTPUT
echo "platform-version=$(lsb_release -rs)" >> $GITHUB_OUTPUT
- name: Download circuits and assignments artifact
uses: dawidd6/action-download-artifact@v3
Expand Down Expand Up @@ -236,7 +245,7 @@ jobs:
fi
targets_str=$(echo "${{ needs.prepare-targets.outputs.prover-targets }}" | awk '{$1=$1};1' | sed '/^$/d' | tr '\n' ' ' | sed 's/ $//')
echo "targets from input: ${targets_str}"
${{ github.workspace }}/tests/make_proof_for_pairs.sh ${extra_args} ${targets_str}
/__w/proof-producer/proof-producer/tests/make_proof_for_pairs.sh ${extra_args} ${targets_str}
- name: Download transpiler output artifact
id: download-to-artifact
Expand Down Expand Up @@ -291,6 +300,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 }}
Expand Down

0 comments on commit 8592a81

Please sign in to comment.