Skip to content

Commit

Permalink
feat: add build CI for windows (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
yihong0618 authored Jan 25, 2023
1 parent 6d98514 commit 3f7d94f
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 20 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,21 @@ jobs:
name: wheels
path: dist

# windows:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v3
# - uses: messense/maturin-action@v1
# with:
# command: build
# args: --release -o dist --find-interpreter
# - name: Upload wheels
# uses: actions/upload-artifact@v3
# with:
# name: wheels
# path: dist
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: messense/maturin-action@v1
with:
command: build
args: --release -o dist --universal2 --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

macos:
runs-on: macos-latest
Expand All @@ -52,7 +54,7 @@ jobs:
- uses: messense/maturin-action@v1
with:
command: build
args: --release -o dist --universal2 --find-interpreter
args: --release -o dist
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand All @@ -63,7 +65,7 @@ jobs:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [macos, linux]
needs: [macos, linux, windows]
steps:
- uses: actions/download-artifact@v3
with:
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ concurrency:
cancel-in-progress: true

jobs:
linux:
runs-on: ubuntu-latest
Testing:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3

Expand All @@ -39,10 +40,22 @@ jobs:
run: |
python -m venv venv
- name: Install tzfpy and test
- name: Install tzfpy and test(not windows)
if: matrix.os != 'windows-latest'
run: |
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements_dev.txt
maturin develop
pytest --cov
- name: Install tzfpy and test(windows)
shell: bash
# for windows need maturin build
if: matrix.os == 'windows-latest'
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements_dev.txt
maturin build
pip install target/wheels/tzfpy-*.whl
pytest --cov
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ pyo3 = { version = "0.18.0", features = ["extension-module"] }
lazy_static = "1.4.0"

# tzf-rs = { git = "http://github.com/ringsaturn/tzf-rs", rev = "8f6873966079f8c27b6816cdfe3a1652469ebd24"}
tzf-rs = "0.2.0"
tzf-rs = "0.2.1"

2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
citiespy==0.3.2
citiespy==0.3.3
maturin==0.14.8
pytest
pytest-benchmark
Expand Down

0 comments on commit 3f7d94f

Please sign in to comment.