refactor: unify some train/test code #55
Workflow file for this run
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
name: "Build wheels" | |
on: | |
pull_request: | |
release: | |
types: [ published ] | |
workflow_dispatch: {} | |
jobs: | |
make-wheels: | |
name: Make ${{ matrix.os }} wheels | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ["macos-latest", "ubuntu-latest", "windows-latest"] | |
fail-fast: false | |
steps: | |
- name: "Checkout repo" | |
uses: actions/checkout@v3 | |
- name: "Build wheels" | |
uses: pypa/[email protected] | |
with: | |
package-dir: . | |
env: | |
CIBW_ENVIRONMENT: > | |
MAUD_REPACKAGE_CMDSTAN=TRUE | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* | |
CIBW_SKIP: "*musllinux*" | |
CIBW_ARCHS: native | |
CIBW_BUILD_FRONTEND: build | |
CIBW_TEST_REQUIRES: pytest | |
CIBW_TEST_COMMAND: "pytest {project}/tests" | |
- name: "Upload wheel as artifact" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifact-${{ matrix.os }}-wheel | |
path: "./**/*.whl" | |
make-sdist: | |
name: Make source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: pipx run build --sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: artifact-source-dist | |
path: "./**/dist/*.tar.gz" | |
upload: | |
name: Upload to PyPI | |
needs: [make-wheels, make-sdist] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v3 | |
- name: Copy artifacts to dist/ folder | |
run: | | |
find . -name 'artifact-*' -exec unzip '{}' \; | |
mkdir -p dist/ | |
find . -name '*.tar.gz' -exec mv '{}' dist/ \; | |
find . -name '*.whl' -exec mv '{}' dist/ \; | |
- name: Upload | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |