Merge pull request #10 from OpenGATE/pyproject #229
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: CI | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- '*' | |
pull_request: | |
branches: [ master ] | |
schedule: | |
- cron: '0 0 * * 0,3' | |
workflow_dispatch: | |
jobs: | |
build_wheel: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout github repo | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
architecture: 'x64' | |
- name: Create Wheel | |
run: | | |
pip install build | |
python -m build | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ matrix.os }}-${{ matrix.python-version }} | |
path: dist/ | |
test_wheel: | |
runs-on: ubuntu-latest | |
needs: [build_wheel] | |
steps: | |
- name: Checkout github repo | |
uses: actions/checkout@v4 | |
- name: Checkout submodules | |
run: git submodule update --init --recursive | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
architecture: 'x64' | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: dist-* | |
merge-multiple: true | |
path: dist/ | |
- name: Test the wheel | |
shell: bash {0} | |
run: | | |
pip install dist/gaga_phsp-*-py3-none-any.whl | |
cd tests | |
mkdir pth | |
python test001_non_cond.py || exit -1 | |
python test002_cond.py || exit -1 | |
publish_wheel: | |
runs-on: ubuntu-latest | |
needs: [test_wheel] | |
steps: | |
- name: Checkout github repo | |
uses: actions/checkout@v4 | |
- name: Checkout submodules | |
run: git submodule update --init --recursive | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: dist-* | |
merge-multiple: true | |
path: dist/ | |
- name: Publish to PyPI | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI }} | |
skip_existing: true | |