CI #255
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/ | |
# ssh_session: | |
# runs-on: ubuntu-latest | |
# needs: [build_wheel] | |
# steps: | |
# - name: Checkout github repo | |
# uses: actions/checkout@v4 | |
# - name: Checkout submodules | |
# shell: bash -l {0} | |
# run: | | |
# export GIT_SSL_NO_VERIFY=1 | |
# git submodule update --init --recursive | |
# - name: Set up Python | |
# 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: Start SSH session | |
# uses: luchihoratiu/debug-via-ssh@main | |
# with: | |
# NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} | |
# SSH_PASS: ${{ secrets.SSH_PASS }} | |
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 | |
cp -r data json mac output log /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/tests/ | |
python ../gaga_phsp/bin/gaga_tests.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 | |