juq papermill-clean
, tests
#8
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: Test / Release | |
on: | |
push: | |
branches: [ "main" ] | |
tags: [ "v**" ] | |
pull_request: | |
branches: [ "**" ] | |
workflow_dispatch: | |
env: | |
python-version: 3.11.6 | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.python-version }} | |
- name: Install juq | |
run: pip install -e .[test] | |
- name: Setup test | |
run: python -m ipykernel install --user --name python3 | |
- name: Run tests | |
run: pytest -v | |
release: | |
name: Release | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.python-version }} | |
- name: Install release deps | |
run: pip install setuptools twine wheel | |
- name: Install juq | |
run: pip install -e . | |
- name: Build release | |
run: python setup.py sdist bdist_wheel | |
- name: Publish release | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: twine upload dist/* |