Skip to content

Commit 3f95417

Browse files
committed
add ci for window
1 parent 652acf0 commit 3f95417

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

.github/workflows/cross_platform_tests.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ env:
1717
GITHUB_ACTIONS_SKIP_NOTIFICATIONS: true
1818
ACTIONS_STEP_DEBUG: false
1919
GITHUB_ACTIONS_NOTIFICATIONS: false
20-
20+
2121
jobs:
2222
build_and_test:
2323
name: Build and test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
2424
runs-on: ${{ matrix.os }}
2525
strategy:
2626
fail-fast: false # Continue with other jobs if one fails
2727
matrix:
28-
os: [ubuntu-latest, macos-latest]
28+
os: [ubuntu-latest, macos-latest, windows-latest]
2929
python-version: ['3.11']
3030

3131
steps:
@@ -63,7 +63,15 @@ jobs:
6363
run: |
6464
python -m venv .venv
6565
echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV
66-
echo "$PWD/.venv/bin" >> $GITHUB_PATH
66+
67+
- name: Set PATH for Unix
68+
if: matrix.os != 'windows-latest'
69+
run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
70+
71+
- name: Set PATH for Windows
72+
if: matrix.os == 'windows-latest'
73+
run: echo "$PWD/.venv/Scripts" >> $GITHUB_PATH
74+
shell: bash
6775

6876
- name: Install dependencies for testing
6977
run: |
@@ -78,7 +86,7 @@ jobs:
7886
- name: Build and install package with maturin
7987
uses: PyO3/maturin-action@v1
8088
with:
81-
target: ${{ matrix.os == 'macos-latest' && 'universal2-apple-darwin' || 'x86_64' }}
89+
target: ${{ matrix.os == 'macos-latest' && 'universal2-apple-darwin' || (matrix.os == 'windows-latest' && 'x86_64-pc-windows-msvc' || 'x86_64') }}
8290
command: develop
8391
args: --release
8492
sccache: 'true'
@@ -90,7 +98,7 @@ jobs:
9098
- name: Build wheel
9199
uses: PyO3/maturin-action@v1
92100
with:
93-
target: ${{ matrix.os == 'macos-latest' && 'universal2-apple-darwin' || 'x86_64' }}
101+
target: ${{ matrix.os == 'macos-latest' && 'universal2-apple-darwin' || (matrix.os == 'windows-latest' && 'x86_64-pc-windows-msvc' || 'x86_64') }}
94102
command: build
95103
args: --release
96104
sccache: 'true'

0 commit comments

Comments
 (0)