Skip to content

Commit

Permalink
adapt CI workflow to upload/download-artifact v4
Browse files Browse the repository at this point in the history
  • Loading branch information
nmandery committed Feb 7, 2024
1 parent c905c43 commit 6e4dd35
Showing 1 changed file with 57 additions and 39 deletions.
96 changes: 57 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-linux-x86_64
path: dist
- name: pytest
shell: bash
Expand Down Expand Up @@ -76,36 +76,48 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-linux-aarch64
path: dist

# commented out as a pre-build rasterio is not available
#- name: pytest
# uses: uraimo/run-on-arch-action@v2.5.0
# with:
# arch: aarch64
# distro: ubuntu22.04
# githubToken: ${{ github.token }}
# install: |
# apt-get update
# apt-get install -y --no-install-recommends python3 python3-pip
# pip3 install -U pip pytest
# run: |
# set -e
# pip3 install h3ronpy[test,pandas,polars] --find-links dist --force-reinstall
# pytest tests


win-macos:

windows-x86_64:
needs:
- cargofmt
- black
- linux-x86_64
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: python install-dev-dependencies.py
- name: Build wheels
uses: PyO3/maturin-action@v1
env:
RUSTFLAGS: "-C target-feature=+fxsr,+sse,+sse2,+sse3,+sse4.1,+sse4.2"
with:
target: x86_64
args: --release --out dist -i python
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-x86_64
path: dist
- name: pytest
shell: bash
run: |
set -e
pip install --force-reinstall dist/*.whl
pytest tests
macos-x86_64:
needs:
- cargofmt
- black
- linux-x86_64
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -125,7 +137,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-macos-x86_64
path: dist
- name: pytest
shell: bash
Expand Down Expand Up @@ -158,7 +170,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-macos-aarch64
path: dist

sdist:
Expand All @@ -177,18 +189,33 @@ jobs:
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels
name: sdist
path: dist

release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/v')"
needs: [ linux-x86_64, linux-aarch64, win-macos, macos-aarch64, sdist ]
needs: [ linux-x86_64, linux-aarch64, windows-x86_64, macos-x86_64, macos-aarch64, sdist ]
steps:
- uses: actions/download-artifact@v4
with:
name: wheels
name: wheels-linux-x86_64
- uses: actions/download-artifact@v4
with:
name: wheels-linux-aarch64
- uses: actions/download-artifact@v4
with:
name: wheels-windows-x86_64
- uses: actions/download-artifact@v4
with:
name: wheels-macos-aarch64
- uses: actions/download-artifact@v4
with:
name: wheels-macos-x86_64
- uses: actions/download-artifact@v4
with:
name: sdist
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
Expand All @@ -203,15 +230,6 @@ jobs:
steps:
- name: checkout repo
uses: actions/checkout@v4

# - name: install rust
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: stable
# override: true
# components: rustfmt

- name: run rustfmt
run: |
cargo fmt -- --check
Expand Down

0 comments on commit 6e4dd35

Please sign in to comment.