Skip to content

Commit

Permalink
add Windows build (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringsaturn authored Jan 25, 2023
1 parent b11c490 commit 1ca3dc6
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 7 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/release-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ on:
paths:
- "citiespy/**"
- "src/**"
- ".github/workflows/test-python.yaml"
- ".github/workflows/test-python.yml"
- ".github/workflows/release-python.yml"
release:
types:
- published
Expand Down Expand Up @@ -55,11 +56,28 @@ jobs:
name: wheels
path: citiespy/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 --find-interpreter
working-directory: citiespy
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: citiespy/dist

release:
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
43 changes: 42 additions & 1 deletion .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths:
- "citiespy/**"
- "src/**"
- ".github/workflows/test-python.yaml"
- ".github/workflows/test-python.yml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -60,3 +60,44 @@ jobs:
- name: Run tests and report coverage
run: pytest --cov tests/

windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "citiespy/requirements_dev.txt"

- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2022-12-20

- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: citiespy

- name: Install
shell: bash
run: |
maturin build
pip install target/wheels/citiespy-*.whl
- name: Run tests and report coverage
run: pytest --cov tests/
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cities-json"
version = "0.3.2"
version = "0.3.3"
edition = "2021"
license-file = "LICENSE"
description = "Get cities"
Expand Down
2 changes: 1 addition & 1 deletion citiespy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "citiespy"
version = "0.3.2"
version = "0.3.3"
edition = "2021"
license-file = "../LICENSE"

Expand Down
2 changes: 1 addition & 1 deletion citiespy/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["maturin"]
requires = ["maturin>=0.14,<0.15"]
build-backend = "maturin"

[project]
Expand Down

0 comments on commit 1ca3dc6

Please sign in to comment.