Update READMEs #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GoLang | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check-changed-files: | |
uses: ./.github/workflows/check-changed-files.yml | |
check-format: | |
name: Check Code Format | |
runs-on: ubuntu-22.04 | |
needs: check-changed-files | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22.0' | |
- name: Check gofmt | |
if: needs.check-changed-files.outputs.golang == 'true' | |
run: if [[ $(go list ./... | xargs go fmt) ]]; then echo "Please run go fmt"; exit 1; fi | |
# TODO - add runtime tests to the workflow | |
# TODO - add core tests to the workflow | |
build-curves-linux: | |
name: Build and test curves on Linux | |
runs-on: [self-hosted, Linux, X64, icicle] | |
needs: [check-changed-files, check-format] | |
strategy: | |
matrix: | |
curve: | |
- name: bn254 | |
build_args: | |
- name: bls12_381 | |
build_args: | |
- name: bls12_377 | |
build_args: | |
- name: bw6_761 | |
build_args: | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Checkout CUDA Backend | |
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp == 'true' | |
uses: actions/checkout@v4 | |
with: | |
repository: ingonyama-zk/icicle-cuda-backend | |
path: ./icicle/backend/cuda | |
ssh-key: ${{ secrets.CUDA_PULL_KEY }} | |
ref: ${{ needs.extract-cuda-backend-branch.outputs.cuda-backend-branch }} | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22.0' | |
- name: Build | |
working-directory: ./wrappers/golang | |
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp == 'true' | |
# builds a single curve with the curve's specified build args | |
run: | | |
./build.sh -curve=${{ matrix.curve.name }} ${{ matrix.curve.build_args }} -cuda_backend=local | |
- name: Test | |
working-directory: ./wrappers/golang/curves | |
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp == 'true' | |
run: | | |
CURVE=$(echo ${{ matrix.curve.name }} | sed -e 's/_//g') | |
export ICICLE_BACKEND_INSTALL_DIR=/usr/local/lib | |
go test ./$CURVE/tests -count=1 -failfast -p 2 -timeout 60m -v |