From 065f80d44ce280442b0a31ab71760f5d7d4875f8 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Wed, 11 Sep 2024 23:21:29 +0530 Subject: [PATCH] CI: fix windows tests --- .github/workflows/tests.yml | 65 ++++++++++--------------------------- 1 file changed, 18 insertions(+), 47 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 034cee60..9a3a912b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,15 +2,14 @@ name: Test on: push: - branches: [main,tests-build,v*] + branches: [main, tests-build, v*] pull_request: - branches: [main,v*] + branches: [main, v*] concurrency: group: ${{ github.ref }} cancel-in-progress: true - jobs: test: name: ${{ matrix.os }} - ${{ matrix.python-version }} @@ -19,7 +18,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -65,78 +64,50 @@ jobs: path: .pytest_temp/ msvc: - name: ${{matrix.os}} - ${{matrix.python-version}} + name: ${{matrix.os}} - ${{matrix.python-version}} - ${{matrix.architecture}} runs-on: ${{matrix.os}} strategy: fail-fast: false matrix: os: [windows-2022] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + architecture: ["x64", "x86"] steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} for x64 + - name: Set up Python ${{ matrix.python-version }} for ${{matrix.architecture}} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - architecture: "x64" + architecture: ${{matrix.architecture}} allow-prereleases: true - name: Cache Windows id: cache-windows uses: actions/cache@v3 with: path: C:\cibw\pkg-config - key: ${{ hashFiles('packing/download_dlls.py') }}-${{ hashFiles('packing/build_pkgconfig.ps1') }}-1 + key: ${{ hashFiles('packing/download_dlls.py') }}-${{ hashFiles('packing/build_pkgconfig.ps1') }} - name: Download Binary run: | python packing/download_dlls.py - - name: Set Path + - name: Set Path for pkg-config run: | $env:Path = "C:\cibw\pkg-config\bin;C:\cibw\vendor\bin;$($env:PATH)" echo "$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - name: Test x64 + - name: Install Python Dependencies run: | python -m pip install -U pip pip install -U setuptools wheel - $env:PKG_CONFIG_PATH="C:\cibw\vendor\lib\pkgconfig" - pip install -r requirements-dev.txt - python setup.py build_ext -i - pytest - - name: Coverage - run: | - coverage report - coverage html - coverage xml - - name: Set up Python ${{ matrix.python-version }} for x86 - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - architecture: "x86" - allow-prereleases: true - - name: Download Binary - run: | - python packing/download_dlls.py - - name: Build x86 Build - run: | - python -m pip install -U pip - $env:PATH="$env:PATH;C:\cibw\vendor\pkg-config\bin;C:\cibw\vendor\bin" - $env:PKG_CONFIG_PATH="C:\cibw\vendor\lib\pkgconfig" pip install -r requirements-dev.txt - python setup.py build_ext -i - python setup.py sdist - python -m pip install dist/* - $env:PATH="C:\cibw\vendor\bin;$env:PATH" - pytest - - name: Coverage + - name: Build Project + env: + PKG_CONFIG_PATH: C:\cibw\vendor\lib\pkgconfig + run: python setup.py build_ext -i + - name: Run tests run: | - coverage report - coverage html - coverage xml - - uses: codecov/codecov-action@v3 - with: - file: ./.coverage/coverage.xml + pytest -s - uses: actions/upload-artifact@v3 with: - name: test-artifacts-${{matrix.os}}-${{matrix.python-version}} + name: test-artifacts-${{matrix.os}}-${{matrix.python-version}} ${{matrix.architecture}} path: .pytest_temp/ success-win: needs: [msvc]