From a410dcbe9a9c0db5d2e254302876e8e9b0af3a40 Mon Sep 17 00:00:00 2001 From: Aleksandr Karpinskii Date: Tue, 16 Jul 2024 22:45:27 +0400 Subject: [PATCH] Add accelerated test builds --- .github/workflows/test.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e63333b0da..9e6fcab32e1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,15 +52,19 @@ jobs: include: - { python-version: "3.11", PYTHONOPTIMIZE: 1, REVERSE: "--reverse" } - { python-version: "3.10", PYTHONOPTIMIZE: 2 } + # SIMD-accelerated builds for x86 + - { os: "ubuntu-latest", python-version: "3.9", acceleration: "sse4"} + - { os: "ubuntu-latest", python-version: "3.12", acceleration: "avx2"} # Free-threaded - { os: "ubuntu-latest", python-version: "3.13-dev", disable-gil: true } # M1 only available for 3.10+ - { os: "macos-13", python-version: "3.9" } + - { os: "macos-13", python-version: "3.9", acceleration: "avx2"} exclude: - { os: "macos-14", python-version: "3.9" } runs-on: ${{ matrix.os }} - name: ${{ matrix.os }} Python ${{ matrix.python-version }} ${{ matrix.disable-gil && 'free-threaded' || '' }} + name: ${{ matrix.os }} Python ${{ matrix.python-version }} ${{ matrix.acceleration }} ${{ matrix.disable-gil && 'free-threaded' || '' }} steps: - uses: actions/checkout@v4 @@ -108,7 +112,7 @@ jobs: GHA_LIBIMAGEQUANT_CACHE_HIT: ${{ steps.cache-libimagequant.outputs.cache-hit }} - name: Install macOS dependencies - if: startsWith(matrix.os, 'macOS') + if: startsWith(matrix.os, 'macos') run: | .github/workflows/macos-install.sh env: @@ -118,6 +122,11 @@ jobs: if: "matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'" run: echo "::add-matcher::.github/problem-matchers/gcc.json" + - name: Set compiler options for optimization + if: ${{ matrix.acceleration }} + run: | + echo "CC=cc -m${{ matrix.acceleration }}" >> $GITHUB_ENV + - name: Build run: | .ci/build.sh