[pre-commit.ci] pre-commit autoupdate #450
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: Tests | |
on: [push, pull_request] | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Run pre-commit | |
uses: pre-commit/[email protected] | |
test: | |
runs-on: ${{ matrix.os }} | |
needs: pre-commit | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
python-version: [3.8, 3.9] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip wheel | |
pip install . | |
python -m pip install -r requirements_dev.txt | |
- name: Show installed packages | |
run: pip freeze | |
- name: Run unit tests | |
run: pytest tests/test_pyglotaran_alias.py | |
- name: Uninstall pyglotaran | |
run: pip uninstall pyglotaran -y | |
- name: Test cli exception | |
run: pytest tests/test_cli_exception.py | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
needs: [test] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install -U pip wheel setuptools | |
- name: Build dist | |
run: | | |
python setup.py sdist bdist_wheel | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_pyglotaran_alias_token }} |