Skip to content

Commit

Permalink
Upload only proofs from a single configuration, fix matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
x-mass committed Dec 21, 2023
1 parent bc41526 commit af67299
Showing 1 changed file with 11 additions and 40 deletions.
51 changes: 11 additions & 40 deletions .github/workflows/reusable-generate-proofs-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,55 +30,19 @@ on:
required: false
default: '1.81.0'

# Matrix parameters
cpp-compiler:
description: 'List of C++ compilers to use for building (one per line)'
required: false
type: string
default: |
g++
clang++
build-type:
description: 'Build type (e.g., Release, Debug, one per line)'
required: false
type: string
default: |
Release
outputs:
artifact-name:
description: "The name of the artifact with circuits, assignments and proofs"
value: ${{ jobs.build-and-test.outputs.artifact-name }}


jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
cpp-compiler: ${{ steps.set-matrix-outputs.outputs.cpp-compiler }}
build-type: ${{ steps.set-matrix-outputs.outputs.build-type }}
steps:
- name: Set up job matrix outputs
id: set-matrix-outputs
run: |
process_input() {
echo "$1" | sed '/^\s*$/d' | jq -R -s -c 'split("\n") | if last == "" then .[:-1] else . end'
}
cpp_compiler=$(process_input "${{ inputs.cpp-compiler }}")
build_type=$(process_input "${{ inputs.build-type }}")
echo "cpp-compiler=${cpp_compiler}" >> $GITHUB_OUTPUT
echo "build-type=${build_type}" >> $GITHUB_OUTPUT
build-and-test:
needs: setup-matrix
runs-on: ubuntu-22.04
strategy:
matrix:
cpp_compiler: ${{fromJson(needs.setup-matrix.outputs.cpp-compiler)}}
build_type: ${{fromJson(needs.setup-matrix.outputs.build-type)}}
cpp-compiler: [ g++, clang++ ]
build-type: [ Release ]
fail-fast: false
outputs:
artifact-name: ${{ steps.set-artifact-name.outputs.artifact-name }}
Expand Down Expand Up @@ -160,7 +124,8 @@ jobs:
cmake \
-G "Unix Makefiles" \
-B build \
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_COMPILER=${{ matrix.cpp-compiler }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
- name: Build proof-producer
working-directory: ${{ steps.strings.outputs.build-dir }}
Expand All @@ -178,13 +143,19 @@ jobs:
echo "targets from input: ${targets_str}"
${{ github.workspace }}/tests/make_proof_for_pairs.sh ${targets_str}
- name: Remove all except proof.bin files
working-directory: ${{ steps.strings.outputs.artifact-dir }}
run: |
find . -type f ! -name 'proof.bin' -exec rm {} +
- name: Set artifact name output
id: set-artifact-name
run: |
echo "artifact-name=${{ inputs.output-artifact-name }}" >> $GITHUB_OUTPUT
# Artifacts from different matrix combinations will overwrite each other
- name: Upload circuits, assignments and proofs artifact
# Only from a single matrix configuration. Assuming everyone produce the same results if not failed.
if: matrix.cpp-compiler == 'g++' && matrix.build-type == 'Release'
uses: actions/upload-artifact@v3
with:
name: ${{ steps.set-artifact-name.outputs.artifact-name }}
Expand Down

0 comments on commit af67299

Please sign in to comment.