| 1 |
|
| 2 |
--- |
| 3 |
|
| 4 |
on: |
| 5 |
- push |
| 6 |
|
| 7 |
env: |
| 8 |
PYTHONUNBUFFERED: 1 |
| 9 |
|
| 10 |
jobs: |
| 11 |
test: |
| 12 |
strategy: |
| 13 |
matrix: |
| 14 |
include: |
| 15 |
- python: 3.12 |
| 16 |
- python: 3.7 |
| 17 |
name: Test |
| 18 |
runs-on: ubuntu-latest |
| 19 |
steps: |
| 20 |
- name: setup python ${{ matrix.python }} |
| 21 |
uses: actions/setup-python@v4 |
| 22 |
with: |
| 23 |
python-version: ${{ matrix.python }} |
| 24 |
- name: upgrade pip |
| 25 |
run: pip install --upgrade pip |
| 26 |
- name: checkout |
| 27 |
uses: actions/checkout@v3 |
| 28 |
- name: install editable package |
| 29 |
run: pip install -e . |
| 30 |
- name: Install test dependencies |
| 31 |
run: pip install -r ./requirements-test.txt |
| 32 |
- name: run unit tests |
| 33 |
run: ./unit_tests.sh |
| 34 |
|
| 35 |
pypi-publish: |
| 36 |
name: Upload release to PyPI |
| 37 |
needs: |
| 38 |
- test |
| 39 |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 40 |
|
| 41 |
runs-on: ubuntu-latest |
| 42 |
environment: |
| 43 |
name: pypi |
| 44 |
url: https://pypi.org/p/clickdc |
| 45 |
permissions: |
| 46 |
id-token: write |
| 47 |
steps: |
| 48 |
- name: checkout |
| 49 |
uses: actions/checkout@v3 |
| 50 |
- name: install build python package |
| 51 |
run: pip install --upgrade build |
| 52 |
- name: build the package |
| 53 |
run: python -m build |
| 54 |
- name: Publish package distributions to PyPI |
| 55 |
uses: pypa/gh-action-pypi-publish@release/v1 |