|
86 | 86 | path: binaries/odiff-macos-arm64 |
87 | 87 | retention-days: 14 |
88 | 88 |
|
| 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 | + |
89 | 133 | test: |
90 | 134 | name: Run Tests (all targets) |
91 | 135 | runs-on: ${{ matrix.os }} |
@@ -139,6 +183,43 @@ jobs: |
139 | 183 | run: | |
140 | 184 | echo "Skipping: no hosted runner available for ${{ matrix.target }}" |
141 | 185 |
|
| 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 | +
|
142 | 223 | e2e-tests: |
143 | 224 | name: End-to-end JavaScript tests |
144 | 225 | needs: [build] |
|
0 commit comments