Skip to content

Commit

Permalink
Add .github/workflows/ci.yml to exercise PoCs' build procedures.
Browse files Browse the repository at this point in the history
  • Loading branch information
dot-asm committed Dec 6, 2023
1 parent 71a9656 commit 62ba663
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: build

on:
push:
branches:
- '**'
workflow_dispatch:
branches:
- '**'
pull_request:
branches:
- main

jobs:
cargo-test-no-run:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- name: Get date
id: get-date
run: echo "date=$(date -u +%Y-%m)" >> $GITHUB_OUTPUT
shell: bash

- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
**/Cargo.lock
**/target
/usr/local/cuda-12.3
key: ${{ runner.os }}-cargo-${{ steps.get-date.outputs.date }}

- name: Environment
shell: bash
run: |
lscpu 2>/dev/null && echo --- || true
env | sort
- name: Install cuda-minimal-build-12-3
shell: bash
run: |
if [ ! -d /usr/local/cuda-12.3 ]; then
# https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_network
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda-minimal-build-12-3
fi
[ -d /usr/local/cuda-12.3/bin ]
- name: The test
shell: bash
run: |
rustc --version --verbose
export PATH=$PATH:/usr/local/cuda-12.3/bin
( cd poc/ntt-cuda
cargo test --release --no-run --features=bls12_381
cargo test --release --no-run --features=gl64
cargo test --release --no-run --features=bb31
export CXX=clang++
cargo test --release --no-run --features=bls12_381
cargo test --release --no-run --features=gl64
cargo test --release --no-run --features=bb31
cargo clean -p ntt-cuda
cargo clean -p ntt-cuda --release
)
( cd poc/msm-cuda
cargo test --release --no-run --features=bls12_381
cargo test --release --no-run --features=bn254
export CXX=clang++
cargo test --release --no-run --features=bls12_381
cargo test --release --no-run --features=bn254
cargo clean -p msm-cuda
cargo clean -p msm-cuda --release
)
rm -rf poc/*/target/.rustc_info.json
rm -rf poc/*/target/package
rm -rf poc/*/target/{debug,release}/incremental
rm -rf poc/*/target/*/{debug,release}/incremental
rm -rf ~/.cargo/registry/src
rm -rf ~/.cargo/registry/index/*/.cache

0 comments on commit 62ba663

Please sign in to comment.