-
Notifications
You must be signed in to change notification settings - Fork 65
161 lines (147 loc) · 4.87 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: test-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
go/pkg
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: |
# 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
[ -d /usr/local/cuda-12.3/bin ]
- name: Test-build poc/ntt-cuda with cuda-12.3
shell: bash
run: |
rustc --version --verbose
export PATH=$PATH:/usr/local/cuda-12.3/bin
( cd poc/ntt-cuda
cargo update
cargo test --no-run --release --features=bls12_381
cargo test --no-run --release --features=gl64
cargo test --no-run --release --features=bb31
if which clang++ 2>/dev/null; then
echo
echo Testing with clang++
echo
clang++ --version
echo
export CXX=clang++
cargo test --no-run --release --features=bls12_381
cargo test --no-run --release --features=gl64
cargo test --no-run --release --features=bb31
fi
cargo clean -p ntt-cuda
cargo clean -p ntt-cuda --release
)
- name: Test-build poc/msm-cuda with cuda-12.3
shell: bash
run: |
rustc --version --verbose
export PATH=$PATH:/usr/local/cuda-12.3/bin
( cd poc/msm-cuda
sed "s/^crit/#crit/" Cargo.toml > Cargo.$$.toml && \
mv Cargo.$$.toml Cargo.toml
cargo update
cargo test --no-run --release --features=bls12_381,quiet
cargo test --no-run --release --features=bn254,quiet
if which clang++ 2>/dev/null; then
echo
echo Testing with clang++
echo
clang++ --version
echo
export CXX=clang++
cargo test --no-run --release --features=bls12_381,quiet
cargo test --no-run --release --features=bn254,quiet
fi
cargo clean -p msm-cuda
cargo clean -p msm-cuda --release
)
- name: Test-build Go bridge with cuda-12.3
shell: bash
run: |
go version
export PATH=$PATH:/usr/local/cuda-12.3/bin
( cd poc/go
env CGO_CFLAGS="-O2 -D__SPPARK_CGO_DEBUG__" go test
)
- name: Install cuda-minimal-build-11-8
shell: bash
run: |
sudo apt-get -y install cuda-minimal-build-11-8
[ -d /usr/local/cuda-11.8/bin ]
- name: Test-build poc/ntt-cuda with cuda-11.8
shell: bash
run: |
rustc --version --verbose
export PATH=$PATH:/usr/local/cuda-11.8/bin
( cd poc/ntt-cuda
cargo update
cargo test --no-run --release --features=bls12_381
cargo test --no-run --release --features=gl64
cargo test --no-run --release --features=bb31
cargo clean -p ntt-cuda
cargo clean -p ntt-cuda --release
)
- name: Test-build poc/msm-cuda with cuda-11.8
shell: bash
run: |
rustc --version --verbose
export PATH=$PATH:/usr/local/cuda-11.8/bin
( cd poc/msm-cuda
sed "s/^crit/#crit/" Cargo.toml > Cargo.$$.toml && \
mv Cargo.$$.toml Cargo.toml
cargo update
cargo test --no-run --release --features=bls12_381,quiet
cargo test --no-run --release --features=bn254,quiet
cargo clean -p msm-cuda
cargo clean -p msm-cuda --release
)
- name: Clean up
shell: bash
run: |
( cd poc/ntt-cuda
rm -rf target/.rustc_info.json
rm -rf target/package
rm -rf target/{debug,release}/incremental
rm -rf target/*/{debug,release}/incremental
)
( cd poc/msm-cuda
rm -rf target/.rustc_info.json
rm -rf target/package
rm -rf target/{debug,release}/incremental
rm -rf target/*/{debug,release}/incremental
)
rm -rf ~/.cargo/registry/src
rm -rf ~/.cargo/registry/index/*/.cache