Files
icicle/.github/workflows/dev-pr.yml
Jeremy Felder fb52650bbc CI: Additional checks (#155)
adds CI checks for building and testing Golang bindings
adds CI checks for formatting Rust and Golang files
Fixes Golang tests for BN254
Splits Actions checks for PR against main into multiple files

Resolves #108
Resolves #107
Resolves #138
2023-08-31 09:04:53 +03:00

102 lines
3.0 KiB
YAML

name: Dev PR
on:
pull_request:
branches:
- dev
env:
CARGO_TERM_COLOR: always
ARCH_TYPE: sm_70
LD_LIBRARY_PATH: $GITHUB_WORKSPACE/goicicle
jobs:
build-rust-linux:
name: Build Rust on Linux
runs-on: [self-hosted, Linux, X64, icicle]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Build Rust
run: cargo build --release --verbose
test-rust-linux:
name: Test Rust on Linux
needs: build-rust-linux
runs-on: [self-hosted, Linux, X64, icicle]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Run Rust Tests
run: cargo test --release --verbose -- --test-threads=1
formatting-rust:
name: Check Rust Code Formatting
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check rustfmt
run: if [[ $(cargo fmt --check) ]]; then echo "Please run cargo fmt"; exit 1; fi
# - name: Check clippy
# run: cargo clippy --no-deps --all-features --all-targets
build-rust-windows:
name: Build Rust on Windows
runs-on: windows-2022
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Download and Install Cuda
uses: Jimver/cuda-toolkit@v0.2.11
with:
cuda: '12.0.0'
method: 'network'
# https://docs.nvidia.com/cuda/archive/12.0.0/cuda-installation-guide-microsoft-windows/index.html
sub-packages: '["cudart", "nvcc", "thrust"]'
- name: Build Rust Targets
run: cargo build --release --verbose
test-golang-linux:
name: Test Golang on Linux
runs-on: [self-hosted, Linux, X64, icicle]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Build CUDA libs
run: make libbn254.so
working-directory: ./goicicle
- name: Run Golang Tests
run: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/goicicle
go test ./goicicle/curves/bn254 -count=1
# TODO: Fix tests for bls12377
# TODO: Fix tests for bls12381
# run: go test ./goicicle/curves/bn254 ./goicicle/curves/bls12377 ./goicicle/curves/bls12381 -count=1
formatting-golang:
name: Check Golang Code Formatting
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check gofmt
run: if [[ $(go list ./... | xargs go fmt) ]]; then echo "Please run go fmt"; exit 1; fi
# TODO: Add once Golang make file supports building for Windows
# build-golang-windows:
# name: Build Golang on Windows
# runs-on: windows-2022
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v3
# - name: Download and Install Cuda
# uses: Jimver/cuda-toolkit@v0.2.11
# with:
# cuda: '12.0.0'
# method: 'network'
# # https://docs.nvidia.com/cuda/archive/12.0.0/cuda-installation-guide-microsoft-windows/index.html
# sub-packages: '["cudart", "nvcc", "thrust"]'
# - name: Build cpp libs
# run: cd goicicle && make all