Skip to content

Commit fd264a7

Browse files
committed
Add avx CI run
1 parent ef7078f commit fd264a7

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

.github/workflows/build.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,50 @@ jobs:
8686
path: binaries/odiff-macos-arm64
8787
retention-days: 14
8888

89+
build-avx:
90+
name: Build (AVX-accelerated x86_64)
91+
runs-on: ubuntu-latest
92+
steps:
93+
- name: Checkout code
94+
uses: actions/checkout@v4
95+
96+
- name: Setup Zig
97+
uses: mlugg/setup-zig@v2
98+
with:
99+
version: 0.15.1
100+
101+
- name: Install nasm
102+
run: |
103+
sudo apt-get update
104+
sudo apt-get install -y nasm
105+
106+
- name: Cross-compile with AVX enabled (x86_64 targets)
107+
run: |
108+
zig build -Doptimize=ReleaseFast -Davx512_diff=true ci --verbose
109+
110+
- name: Prepare AVX binaries as artifacts
111+
run: |
112+
mkdir -p binaries
113+
# Only publish x86_64 Linux and macOS AVX builds to avoid interfering with release job
114+
cp zig-out/x86_64-linux/odiff binaries/avx-odiff-linux-x64
115+
cp zig-out/x86_64-macos/odiff binaries/avx-odiff-macos-x64
116+
117+
- name: Upload AVX x86_64-linux artifact
118+
uses: actions/upload-artifact@v4
119+
with:
120+
if-no-files-found: error
121+
name: avx-odiff-linux-x64
122+
path: binaries/avx-odiff-linux-x64
123+
retention-days: 14
124+
125+
- name: Upload AVX x86_64-macos artifact
126+
uses: actions/upload-artifact@v4
127+
with:
128+
if-no-files-found: error
129+
name: avx-odiff-macos-x64
130+
path: binaries/avx-odiff-macos-x64
131+
retention-days: 14
132+
89133
test:
90134
name: Run Tests (all targets)
91135
runs-on: ${{ matrix.os }}
@@ -139,6 +183,43 @@ jobs:
139183
run: |
140184
echo "Skipping: no hosted runner available for ${{ matrix.target }}"
141185
186+
test-avx:
187+
name: Run Tests (AVX x86_64)
188+
runs-on: ${{ matrix.os }}
189+
strategy:
190+
matrix:
191+
include:
192+
- target: x86_64-linux-gnu
193+
os: ubuntu-latest
194+
- target: x86_64-macos
195+
os: macos-latest
196+
defaults:
197+
run:
198+
shell: bash
199+
steps:
200+
- name: Checkout code
201+
uses: actions/checkout@v4
202+
203+
- name: Setup Zig
204+
uses: mlugg/setup-zig@v2
205+
with:
206+
version: 0.15.1
207+
208+
- name: Install nasm for x86 targets (Linux)
209+
if: contains(matrix.target, 'x86_64') && runner.os == 'Linux'
210+
run: |
211+
sudo apt-get update
212+
sudo apt-get install -y nasm
213+
214+
- name: Install nasm for x86 targets (macOS)
215+
if: contains(matrix.target, 'x86_64') && runner.os == 'macOS'
216+
run: |
217+
brew install nasm
218+
219+
- name: Run AVX tests
220+
run: |
221+
zig build -Davx512_diff=true test-all --summary all
222+
142223
e2e-tests:
143224
name: End-to-end JavaScript tests
144225
needs: [build]

0 commit comments

Comments
 (0)