-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add .github/workflows/ci.yml to exercise PoCs' build procedures.
- Loading branch information
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
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
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 |