-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to Python 3.11 and refactor CI (#6)
* Update to Python 3.11 * Bump minor version * Fix version * Update required version * New action for building, testing and deploying * Remove obsolete actions * Install Rust toolchain in CI * Exclude images from distribution * Exclude tests from distribution * Make Rust toolchain available for build * Fix PATH * Add test whether cargo is properly installed * Fiy typo * Remove usage of cibuildwheel Due to the issue, that the build environment could not find Cargo * Move 'python-source' to 'pyproject.toml' * Fix maturin commands * Update runners * Use bash for commands * Potential fix
- Loading branch information
Showing
6 changed files
with
102 additions
and
143 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
--- | ||
name: "CI & CD" | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
release: | ||
types: | ||
- published | ||
|
||
|
||
jobs: | ||
wheels: | ||
name: "Build & test wheel" | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
py-version: ["3.9", "3.10", "3.11"] | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.py-version }} | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: Install dependencies | ||
run: pip install "maturin>=0.14,<0.15" "oldest-supported-numpy" pytest | ||
- name: Build wheel | ||
run: maturin build --release -i python -o dist | ||
- name: Install wheel | ||
run: pip install .//dist//*.whl | ||
- name: Test wheel | ||
run: pytest --assert=plain | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: .//dist//*.whl | ||
|
||
|
||
sdist: | ||
name: Build & test source distribution | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.11" | ||
- name: Install dependencies | ||
run: pip install "maturin>=0.14,<0.15" pytest | ||
- name: Build source distribution | ||
run: maturin sdist -o dist | ||
- name: Install source distribution | ||
run: pip install .//dist//*.tar.gz | ||
- name: Test source distribution | ||
run: pytest --assert=plain | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist//*.tar.gz | ||
|
||
|
||
upload: | ||
name: Upload to GitHub Releases & PyPI | ||
permissions: | ||
contents: write | ||
needs: [wheels, sdist] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
- name: List distributions to be uploaded | ||
run: ls dist | ||
- name: Upload to GitHub Releases | ||
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
with: | ||
files: dist//* | ||
- name: Upload to PyPI | ||
uses: pypa/gh-action-pypi-publish@c7f29f7adef1a245bd91520e94867e5c6eedddcc | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
with: | ||
password: ${{ secrets.PYPI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters