-
-
Notifications
You must be signed in to change notification settings - Fork 12
225 lines (208 loc) · 9.08 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
name: CI
on:
push:
pull_request:
schedule:
- cron: '0 0 1 * *'
jobs:
CUDALucas:
name: CUDALucas
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Before script
run: |
sed -i '/^GPU=/,/^fi/ s/^/# /' cudalucas.sh
sed -i 's/ -flto//' cudalucas.sh
sed -i '/^if ! COMPUTE=/,/^fi/ s/^/# /' cudalucas.sh
sed -i 's/\/$COMPUTE/\/-gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70/' cudalucas.sh
sed -i '/^\.\/CUDALucas / s/^/# /' cudalucas.sh
sed -i '/^nohup / s/^/# /' cudalucas.sh
sed -i '/^python3 / s/^/# /' cudalucas.sh
sed -i '/^crontab / s/^/# /' cudalucas.sh
gcc --version
- name: Script
run: bash -e -o pipefail -- cudalucas.sh ANONYMOUS
- uses: actions/upload-artifact@v3
if: always()
with:
name: ${{ matrix.os }}_cudalucas
path: |
cudalucas/
- name: ShellCheck
run: bash -c 'shopt -s globstar; shellcheck -o avoid-nullary-conditions,check-extra-masked-returns,check-set-e-suppressed,deprecate-which,quote-safe-variables,require-double-brackets -s bash **/*.sh'
continue-on-error: true
- name: Clang-Tidy
run: cd cudalucas && clang-tidy --use-color -checks='bugprone-*,cert-*,clang-analyzer-*,concurrency-*,misc-const-correctness,misc-redundant-expression,misc-unused-*,performance-*,portability-*,readability-const-return-type,readability-container-*,readability-duplicate-include,readability-else-after-return,readability-make-member-function-cons,readability-non-const-parameter,readability-redundant-*,readability-simplify-*,readability-string-compare,readability-use-anyofallof' -header-filter='.*' *.c *.cu -- -Wall -O3 --cuda-gpu-arch=sm_35
GpuOwl:
name: GpuOwl
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.cxx == 'clang++' && matrix.os == 'ubuntu-22.04' }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
cxx: [g++, clang++]
fail-fast: false
env:
CXX: ${{ matrix.cxx }}
steps:
- uses: actions/checkout@v4
- name: Install
run: |
sudo apt-get -yqq update
sudo apt-get -yqq install ocl-icd-opencl-dev pocl-opencl-icd
- name: Before script
run: |
sed -i '/^GPU=/,/^fi/ s/^/# /' gpuowl.sh
sed -i '/^nohup / s/^/# /' gpuowl.sh
sed -i '/^python3 / s/^/# /' gpuowl.sh
sed -i '/^crontab / s/^/# /' gpuowl.sh
$CXX --version
- name: Script
run: bash -e -o pipefail -- gpuowl.sh ANONYMOUS
- uses: actions/upload-artifact@v3
if: always()
with:
name: ${{ matrix.os }}_gpuowl
path: |
gpuowl/
- name: ShellCheck
run: bash -c 'shopt -s globstar; shellcheck -o avoid-nullary-conditions,check-extra-masked-returns,check-set-e-suppressed,deprecate-which,quote-safe-variables,require-double-brackets -s bash **/*.sh'
continue-on-error: true
Mlucas:
name: Mlucas
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.cc == 'clang' }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
cc: [gcc, clang]
fail-fast: false
env:
CC: ${{ matrix.cc }}
steps:
- uses: actions/checkout@v4
- name: Before script
run: |
sed -i '/^[[:blank:]]*nohup / s/^/# /' mlucas.sh
sed -i '/^python3 / s/^/# /' mlucas.sh
$CC --version
- name: Script
run: |
set -x
bash -e -o pipefail -- mlucas.sh ANONYMOUS
echo -e '## Warnings\n```' >> $GITHUB_STEP_SUMMARY
grep 'warning:' mlucas_v*/obj/build.log | sed 's/\x1B\[\([0-9]\+\(;[0-9]\+\)*\)\?m//g' | awk '{ print $NF }' | sort | uniq -c | sort -nr >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: GCC analyzer
if: ${{ matrix.os == 'ubuntu-22.04' && matrix.cc == 'gcc' }}
run: |
set -x
cd mlucas_v*/obj/ && $CC -c -fdiagnostics-color -g -O3 -march=native -DUSE_THREADS -fanalyzer ../src/*.c |& tee analyzer.log
make clean
echo -e '## GCC analyzer\n```' >> $GITHUB_STEP_SUMMARY
grep 'warning:' analyzer.log | sed 's/\x1B\[\([0-9]\+\(;[0-9]\+\)*\)\?m//g' | awk '{ print $NF }' | sort | uniq -c | sort -nr >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: Clang-Tidy
if: ${{ matrix.cc == 'clang' }}
run: |
set -x
cd mlucas_v*/obj/ && clang-tidy --use-color -checks='bugprone-*,cert-*,clang-analyzer-*,concurrency-*,misc-const-correctness,misc-redundant-expression,misc-unused-*,modernize-*,performance-*,portability-*,readability-const-return-type,readability-container-*,readability-duplicate-include,readability-else-after-return,readability-make-member-function-cons,readability-non-const-parameter,readability-redundant-*,readability-simplify-*,readability-string-compare,readability-use-anyofallof' -header-filter='.*' ../src/*.c -- -Wall -O3 -march=native -DUSE_THREADS |& tee clang-tidy.log
echo -e '## Clang-Tidy\n```' >> $GITHUB_STEP_SUMMARY
grep 'warning:' clang-tidy.log | sed 's/\x1B\[\([0-9]\+\(;[0-9]\+\)*\)\?m//g' | awk '{ print $NF }' | sort | uniq -c | sort -nr >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- uses: actions/upload-artifact@v3
if: always()
with:
name: ${{ matrix.os }}_${{ matrix.cc }}_mlucas
path: |
mlucas_v*/
- name: ShellCheck
run: bash -c 'shopt -s globstar; shellcheck -o avoid-nullary-conditions,check-extra-masked-returns,check-set-e-suppressed,deprecate-which,quote-safe-variables,require-double-brackets -s bash **/*.sh'
continue-on-error: true
Pylint:
name: Pylint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pylint
- name: Script
run: pylint -f colorized --py-version 2.6 -d design,C0103,W0311,C0301,C0302,C0209 --load-plugins pylint.extensions.code_style,pylint.extensions.emptystring,pylint.extensions.comparetozero,pylint.extensions.comparison_placement,pylint.extensions.for_any_all,pylint.extensions.consider_refactoring_into_while_condition,pylint.extensions.consider_ternary_expression,pylint.extensions.dict_init_mutate,pylint.extensions.docstyle,pylint.extensions.check_elif,pylint.extensions.set_membership,pylint.extensions.typing -e R6104 -r y *.py mprime-python-port/*.py
continue-on-error: true
Ruff:
name: Ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install ruff
- name: Script
run: ruff --output-format=github --target-version py37 --select F,E,W,I,D,UP,YTT,S,BLE,B,A,C4,T10,EM,EXE,ISC,ICN,G,PIE,PYI,Q,RSE,RET,SLF,SLOT,SIM,TID,TCH,ARG,PGH,PL,TRY,PERF,FURB,LOG,RUF --preview --ignore E101,E501,W191,D211,D213,D401,UP004,UP009,UP010,UP024,UP030,UP032,UP036,PYI024,PLR09,PLR2004,S324,S603,RUF001,RUF002,RUF003,RUF005 .
continue-on-error: true
Linux:
name: PrimeNet Linux
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install requests
- name: Script
run: |
set -x
wget https://raw.github.com/tdulcet/Linux-System-Information/master/info.sh -qO - | bash -s --
python3 -X dev -c 'import platform; print(platform.freedesktop_os_release())' || true
python3 -X dev primenet.py --help
macOS:
name: PrimeNet macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install requests
python3 -m pip install --upgrade pip
python3 -m pip install requests
- name: Script
run: |
set -x
sysctl -n machdep.cpu.brand_string
sysctl -n hw.physicalcpu_max hw.logicalcpu_max
sysctl -n hw.cpufrequency hw.cpufrequency_max hw.tbfrequency kern.clockrate
sysctl -n hw.memsize
python -c 'import platform; print(platform.mac_ver())'
python3 -X dev -c 'import platform; print(platform.mac_ver())'
python primenet.py --help
python3 -X dev primenet.py --help
Windows:
name: PrimeNet Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install requests
- name: Script
run: |
wmic cpu get name
wmic cpu get NumberOfCores,NumberOfLogicalProcessors
wmic cpu get MaxClockSpeed
wmic memphysical get MaxCapacity
python -X dev -c "import platform; print(platform.win32_ver())"
python -X dev primenet.py --help