Skip to content

Commit

Permalink
CI: fix windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
naveen521kk committed Sep 11, 2024
1 parent 7ff3c10 commit 065f80d
Showing 1 changed file with 18 additions and 47 deletions.
65 changes: 18 additions & 47 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 065f80d

Please sign in to comment.