Skip to content

Reproduce ci error #154

Reproduce ci error

Reproduce ci error #154

name: Run tests
on:
# Triggers the workflow on pull request events but only for the master branch
pull_request:
branches: [ master ]
push:
branches: [ master ]
jobs:
handle-syncwith:
if: github.event_name == 'pull_request'
name: Call Reusable SyncWith Handler
uses: NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1
with:
ci-cd-ref: 'v1'
secrets: inherit
build-and-test-with-nix:
needs: [ handle-syncwith ]
runs-on: ["self-hosted", "aws_autoscaling"]
outputs:
transpiler-artifact-name: ${{ steps.artifact-names.outputs.transpiler }}
examples-artifact-name: ${{ steps.artifact-names.outputs.examples }}
evm-targets: ${{ steps.get-targets.outputs.evm-targets }}
prover-targets: ${{ steps.get-targets.outputs.prover-targets }}
env:
INTEGRATION_TESTING_TARGETS: |
arithmetics_cpp_example
polynomial_cpp_example
poseidon_cpp_example
merkle_tree_poseidon_cpp_example
uint_remainder_cpp
compare_eq_cpp
private_input_cpp
# uint_shift_left # TODO fix and re-enable tests
# uint_bit_decomposition # TODO fix and re-enable tests
# uint_bit_composition # TODO fix and re-enable tests
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
- name: Checkout submodules to specified refs
if: inputs.submodules-refs != ''
uses: NilFoundation/ci-cd/actions/recursive-checkout@master
with:
refs: ${{ inputs.submodules-refs }}
paths: |
${{ github.workspace }}/**
!${{ github.workspace }}/
!${{ github.workspace }}/**/.git/**
- name: Build zkLLVM, run local tests, prepare for integration testing
run: |
nix build -L .?submodules=1#checks.x86_64-linux.debug-tests
ls
ls -al result/
ls -al result/artifacts/
cd result
find -name "*.ll"
find -name "*.tbl"
find -name "transpiler_output_*"
cd -
ls -al result/artifacts/examples_output
cp -r result/artifacts/examples_output .
- name: Set aritfacts' names
id: artifact-names
run: |
echo "transpiler=transpiler-output" >> $GITHUB_OUTPUT
echo "examples=circuits-and-assignments" >> $GITHUB_OUTPUT
- name: Upload examples' circuits and assignments artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact-names.outputs.examples }}
path: |
examples_output
if-no-files-found: error
- name: Upload examples' circuits and assignments artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact-names.outputs.transpiler }}
path: |
result/artifacts/cpp/transpiler_output_*
if-no-files-found: error
- name: Set targets for integration testing
id: get-targets
run: |
targets_str=$(echo "${{ env.INTEGRATION_TESTING_TARGETS }}" | awk 'NF {print "transpiler_output_" $1}')
echo "evm-targets<<EOF" >> $GITHUB_OUTPUT
echo "${targets_str}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "prover-targets<<EOF" >> $GITHUB_OUTPUT
echo "${{ env.INTEGRATION_TESTING_TARGETS }}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
verify-zkllvm-proofs:
name: Verify built-it proofs with EVM-placeholder
needs:
- build-and-test-with-nix
- handle-syncwith
if: |
always() && !cancelled() &&
(needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped') &&
needs.build-and-test-with-nix.result == 'success'
uses: NilFoundation/evm-placeholder-verification/.github/workflows/reusable-verify-proofs.yml@2a0ef5fc67e97be8e3c7b59338cf9eecd030c57d
with:
artifact-name: ${{ needs.build-and-test-with-nix.outputs.transpiler-artifact-name }}
evm-placeholder-verification-ref: 2a0ef5fc67e97be8e3c7b59338cf9eecd030c57d
refs: ${{ needs.handle-syncwith.outputs.prs-refs }}
test-names: ${{ needs.build-and-test-with-nix.outputs.evm-targets }}
generate-proofs:
name: Generate proofs for cpp examples
needs:
- build-and-test-with-nix
- handle-syncwith
if: |
always() && !cancelled() &&
(needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped') &&
needs.build-and-test-with-nix.result == 'success'
uses: NilFoundation/proof-producer/.github/workflows/reusable-generate-proofs-linux.yml@f3e985dabe0d20ecb75375f86d8cf2a71e2eb58b
with:
artifact-name: ${{ needs.build-and-test-with-nix.outputs.examples-artifact-name }}
# Update next line if you need new version of proof producer
proof-producer-ref: f3e985dabe0d20ecb75375f86d8cf2a71e2eb58b
refs: ${{ needs.handle-syncwith.outputs.prs-refs }}
targets: ${{ needs.build-and-test-with-nix.outputs.prover-targets }}
merge-proofs-to-transpiler-output:
runs-on: ubuntu-22.04
needs:
- generate-proofs
- build-and-test-with-nix
if: |
always() && !cancelled() &&
needs.generate-proofs.result == 'success' &&
needs.build-and-test-with-nix.result == 'success'
outputs:
merged-artifact-name: ${{ steps.artifact-name.outputs.merged }}
steps:
- name: Download artifact with proofs
uses: actions/download-artifact@v3
with:
name: ${{ needs.generate-proofs.outputs.artifact-name }}
- name: Download artifact with transpiler output
uses: actions/download-artifact@v3
with:
name: ${{ needs.build-and-test-with-nix.outputs.transpiler-artifact-name }}
- name: Merge proofs into transpiler output
run: |
copy_failed=0
while read dir; do
base_name=${dir#./transpiler_output_}
if [[ -d "$base_name" ]]; then
if ! cp "${base_name}/proof.bin" "${dir}/"; then
echo "Failed to copy proof.bin to ${dir}" >&2
copy_failed=1
else
echo "proof.bin added to ${dir}"
fi
else
echo "Error: No matching directory found for ${dir}" >&2
fi
done < <(find . -type d -name "transpiler_output_*")
if [ $copy_failed -eq 1 ]; then
echo "One or more copy operations failed."
exit 1
fi
- name: Set aritfact name
id: artifact-name
run: |
echo "merged=transpiler-output-merged-proofs" >> $GITHUB_OUTPUT
- name: Upload merged artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact-name.outputs.merged }}
path: |
transpiler_output_*
verify-proof-producer-proofs:
name: Verify proof-producer proofs with EVM-placeholder
needs:
- handle-syncwith
- merge-proofs-to-transpiler-output
- build-and-test-with-nix
if: |
always() && !cancelled() &&
(needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped') &&
needs.build-and-test-with-nix.result == 'success' &&
needs.merge-proofs-to-transpiler-output.result == 'success'
uses: NilFoundation/evm-placeholder-verification/.github/workflows/reusable-verify-proofs.yml@2a0ef5fc67e97be8e3c7b59338cf9eecd030c57d
with:
artifact-name: ${{ needs.merge-proofs-to-transpiler-output.outputs.merged-artifact-name }}
evm-placeholder-verification-ref: 2a0ef5fc67e97be8e3c7b59338cf9eecd030c57d
refs: ${{ needs.handle-syncwith.outputs.prs-refs }}
test-names: ${{ needs.build-and-test-with-nix.outputs.evm-targets }}
cleanup-integration-testing:
# For now each artifact is 12 GB. Better clean it up to keep the space
name: Clean up after integration testing
needs:
- verify-proof-producer-proofs
- verify-zkllvm-proofs
- merge-proofs-to-transpiler-output
- build-and-test-with-nix
- generate-proofs
if: always()
runs-on: ubuntu-22.04
steps:
- uses: geekyeggo/delete-artifact@v2
with:
name: |
${{ needs.merge-proofs-to-transpiler-output.outputs.merged-artifact-name }}
${{ needs.generate-proofs.outputs.artifact-name }}