-
Notifications
You must be signed in to change notification settings - Fork 11
162 lines (144 loc) · 4.62 KB
/
Copy pathunit_test_linux.yml
File metadata and controls
162 lines (144 loc) · 4.62 KB
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
name: Linux Unit Tests
on:
pull_request:
branches:
- main
# Docs-only changes can't break the tests: skip the build+test run.
paths-ignore:
- '**.md'
- 'documentation/**'
- 'docs/**'
- 'LICENSE'
- '.gitignore'
workflow_dispatch:
# Supersede stale in-progress runs for the same PR.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build-cmake:
uses: ./.github/workflows/cmake_linux.yml
build-boost:
uses: ./.github/workflows/boost_linux.yml
with:
boost_version: "1.91.0"
build-openssl:
uses: ./.github/workflows/openssl_linux.yml
unit-test:
needs: [build-cmake, build-boost, build-openssl]
runs-on: ubuntu-22.04
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
# Explicit allowlist of the hermetic (no-GPU) suites compiled in this
# NVIDIA/AMD/CPU-OFF build. Excludes the GPU device resolvers
# (Resolver*NvidiaTest / Resolver*AmdTest) and the OpenCL/CPU-gated KATs,
# which aren't compiled here.
TEST_FILTER: >-
AlgoTypeTest.*:
AutolykosV2CpuShare.*:
Bitwise.*:
Blake3Ref.*:
EthashTest.*:
FastModTest.*:
Fnv1Test.*:
HashTest.*:
KHeavyHashHeavyHash.*:
KHeavyHashKHeavyHash.*:
KHeavyHashMatrix.*:
KHeavyHashPowHash.*:
Kiss99Test.*:
MathTest.*:
ProgpowKernelOpenCLTest.*:
RotateByteTest.*:
StatisticalHashrate.*:
StratumAutolykosV2NotifyTest.*:
StratumBlake3ProtocolTest.*:
StratumEthashAuthorizeTest.*:
StratumEthashSubmitNonceTest.*:
StratumMath.*:
StratumProgpowSeed.*:
WritePump.*
steps:
- uses: actions/checkout@v4
# ===============================
# Download CMake
# ===============================
- name: Download CMake
uses: actions/download-artifact@v4
with:
name: cmake-linux-3.26.4
path: deps/cmake
- name: Add CMake to PATH
run: |
chmod +x ${{ github.workspace }}/deps/cmake/bin/cmake
echo "${{ github.workspace }}/deps/cmake/bin" >> $GITHUB_PATH
# ===============================
# Restore and install Boost
# ===============================
- name: Restore Boost from cache
uses: actions/cache/restore@v4
with:
path: boost-install
key: boost-${{ runner.os }}-1.91.0
- name: Install Boost
run: |
sudo cp -r boost-install/include/* /usr/local/include/
sudo cp -r boost-install/lib/* /usr/local/lib/
sudo ldconfig
# ===============================
# Restore and install OpenSSL
# ===============================
- name: Restore OpenSSL from cache
uses: actions/cache/restore@v4
with:
path: openssl-install
key: openssl-${{ runner.os }}-1.1.1w
- name: Install OpenSSL
run: |
sudo cp -r openssl-install/include/* /usr/local/include/
sudo cp -r openssl-install/lib/* /usr/local/lib/
sudo ldconfig
# ===============================
# Install system build tools
# ===============================
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
libstdc++-12-dev \
clang-15 \
clang++-15 \
git \
libgnutls28-dev
# ===============================
# Configure and build unit_test
# ===============================
- name: Configure CMake
run: |
mkdir build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang-15 \
-DCMAKE_CXX_COMPILER=clang++-15 \
-DBUILD_EXE_MINER=OFF \
-DBUILD_EXE_BENCHMARK=OFF \
-DBUILD_EXE_UNIT_TEST=ON \
-DBUILD_NVIDIA=OFF \
-DBUILD_AMD=OFF \
-DBUILD_CPU=OFF \
-DTOOL_MOCKER=OFF \
-DENABLE_LTO=OFF \
-DENABLE_NATIVE=OFF
- name: Build unit_test
run: make -j$(nproc) -C build unit_test
# ===============================
# Run tests
# ===============================
- name: Run unit tests
run: |
FILTER=$(echo "${{ env.TEST_FILTER }}" | tr -d '\n' | tr -s ' ' | sed 's/ //g')
echo "Running: bin/unit_test --gtest_filter=${FILTER}"
bin/unit_test \
--gtest_filter="${FILTER}"