Merge branch '913-create_and_publish_wheel_fix' into 'master' #84
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: CARS | |
on: [push, pull_request] | |
jobs: | |
test: | |
name: Install and test CARS | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip meson-python meson ninja setuptools_scm setuptools wheel pybind11 | |
pip install --upgrade cython numpy | |
pip install --no-build-isolation --editable .[dev,docs,notebook,pandora_mccnn] | |
pip list | |
- name: Unit Tests | |
run: | | |
pytest -m "unit_tests" -o log_cli=true -o log_cli_level=INFO | |
- name: Lint Tests | |
run: | | |
echo "Lint test" | |
isort --check cars tests | |
black --check cars tests | |
flake8 cars tests | |
pylint cars tests --rcfile=.pylintrc --output-format=parseable | tee pylint-report.txt # pipefail to propagate pylint exit code in bash | |
- name: Notebooks Tests | |
run: | | |
pytest -m "notebook_tests" -o log_cli=true -o log_cli_level=INFO | |
- name: End2end Tests | |
run: | | |
pytest -m "end2end_tests" -o log_cli=true -o log_cli_level=INFO | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.22.0 | |
- name: Build wheels | |
run: python -m cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-sdist | |
path: dist/*.tar.gz | |
upload_pypi: | |
name: Publish package on pypi | |
needs: [test, build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
environment: pypi | |
permissions: | |
id-token: write | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-* | |
path: dist | |
merge-multiple: true | |
- uses: pypa/gh-action-pypi-publish@release/v1 |