Skip to content

Commit 4a8dfe6

Browse files
committed
feat: Added offline Unit tests to Windows, all CIs now depend on a pre-build check to try improve builds
1 parent 358c49a commit 4a8dfe6

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,44 @@ permissions:
2727
contents: read
2828

2929
jobs:
30+
linux-prebuild:
31+
permissions:
32+
contents: write
33+
name: Linux Pre-Build Check ${{ matrix.cfg.arch }} (${{ matrix.cfg.cpp }}-${{ matrix.cfg.version }}${{ matrix.cfg.name-extra }})
34+
runs-on: ${{ matrix.cfg.os }}
35+
strategy:
36+
fail-fast: false # Don't fail everything if one fails. We want to test each OS/Compiler individually
37+
matrix:
38+
cfg:
39+
- { arch: 'amd64', concurrency: 4, os: ubuntu-24.04, package: clang-18, cpp: clang++, version: 18, cmake-flags: '-DDPP_CORO=ON' }
40+
steps:
41+
- name: Harden Runner
42+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
43+
with:
44+
egress-policy: audit
45+
46+
- name: Checkout D++
47+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
48+
49+
- name: Setup mold
50+
uses: rui314/setup-mold@b015f7e3f2938ad3a5ed6e5111a8c6c7c1d6db6e # v1
51+
52+
- name: Install apt packages
53+
run: sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt update && sudo apt-get install -y ${{ matrix.cfg.package }} pkg-config libopus-dev zlib1g-dev rpm
54+
55+
- name: Generate CMake
56+
run: cmake -B build -DDPP_NO_VCPKG=ON -DAVX_TYPE=AVX0 -DCMAKE_BUILD_TYPE=Release ${{matrix.cfg.cmake-flags}}
57+
env:
58+
CXX: ${{ matrix.cfg.cpp }}-${{ matrix.cfg.version }}
59+
3060
linux:
3161
permissions:
3262
contents: write
3363
concurrency:
3464
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.cfg.arch }}-(${{ matrix.cfg.cpp }}-${{ matrix.cfg.version }})
3565
cancel-in-progress: true
3666
name: Linux ${{ matrix.cfg.arch }} (${{ matrix.cfg.cpp }}-${{ matrix.cfg.version }}${{ matrix.cfg.name-extra }})
67+
needs: linux-prebuild
3768
runs-on: ${{ matrix.cfg.os }}
3869
strategy:
3970
fail-fast: false # Don't fail everything if one fails. We want to test each OS/Compiler individually
@@ -126,6 +157,7 @@ jobs:
126157
permissions:
127158
contents: write
128159
name: macOS ${{ matrix.cfg.arch }} (${{ matrix.cfg.cpp }}-${{ matrix.cfg.version }})
160+
needs: linux-prebuild
129161
runs-on: ${{ matrix.cfg.os }}
130162
strategy:
131163
fail-fast: false # Don't fail everything if one fails. We want to test each OS/Compiler individually
@@ -176,6 +208,7 @@ jobs:
176208
- { name: 'x64-Clang', arch: x64, config: Debug, vs: '2022', os: 'windows-2025', vsv: '17', upload: false, options: '-T ClangCL' }
177209

178210
name: "Windows ${{matrix.cfg.name}}-${{matrix.cfg.config}}-vs${{matrix.cfg.vs}}"
211+
needs: linux-prebuild
179212
runs-on: ${{matrix.cfg.os}}
180213
steps:
181214
- name: Harden Runner
@@ -211,6 +244,9 @@ jobs:
211244
env:
212245
DONT_RUN_VCPKG: true
213246

247+
- name: Run offline unit tests
248+
run: cd build/library && ./unittest
249+
214250
- name: Move debug files for packaging
215251
if: ${{ matrix.cfg.config == 'Debug' }}
216252
run: xcopy main\build\library\Debug\* main\build\library\Release\ /s /q
@@ -239,6 +275,7 @@ jobs:
239275
- {name: "ARMv6", os: ubuntu-24.04, cmake-options: -DDPP_NO_CORO=ON -DCMAKE_TOOLCHAIN_FILE=cmake/ARMv6ToolChain.cmake}
240276

241277
name: ${{matrix.cfg.name}}
278+
needs: linux-prebuild
242279
runs-on: ${{matrix.cfg.os}}
243280
steps:
244281
- name: Harden Runner

0 commit comments

Comments
 (0)