Skip to content

Python: Add support for HIP/ROCm buffers #10

Python: Add support for HIP/ROCm buffers

Python: Add support for HIP/ROCm buffers #10

name: Python Package Tests and Deploy
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [published]
workflow_dispatch:
jobs:
build-wheel:
runs-on: ubuntu-latest
container: ghcr.io/gridtools/gridtools-base:${{ matrix.compiler }}
strategy:
matrix:
python-version: ["3.10"]
compiler: [gcc-10]
build_type: [release]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: install nox
run: |
python -m pip install --upgrade pip setuptools
python -m pip install nox
- name: run tests
working-directory: ./.python_package
run: nox -s test_src
- name: build and test wheel
working-directory: ./.python_package
run: nox -s build_wheel test_wheel_with_python-${{ matrix.python-version }}
- name: archive wheel
uses: actions/upload-artifact@v3
with:
name: gridtools-cpp-wheel
path: .python_package/.nox/.cache/dist/gridtools_cpp-*.whl
- name: Publish distribution to Test PyPI
if: ${{ github.event_name == 'release' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
packages-dir: .python_package/.nox/.cache/dist
- name: Publish distribution to PyPI
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: .python_package/.nox/.cache/dist
test-wheel:
needs: build-wheel
runs-on: ubuntu-latest
container: ghcr.io/gridtools/gridtools-base:${{ matrix.compiler }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.11"]
compiler: [gcc-10]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: install nox
run: |
python -m pip install --upgrade pip setuptools
python -m pip install nox
- name: download wheel
uses: actions/download-artifact@v3
with:
name: gridtools-cpp-wheel
path: .python_package/.nox/.cache/dist
- name: test wheel
working-directory: ./.python_package
run: nox -s test_wheel_with_python-${{ matrix.python-version }}