Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Windows build #12

Merged
merged 10 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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