Improve code with DRY :) #15
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install PantherDB | |
run: python -m pip install . | |
- name: Install Faker | |
run: python -m pip install Faker | |
- name: Run Tests | |
run: python -m unittest tests/test_*.py | |
build-n-publish: | |
name: Build and publish to PyPI | |
runs-on: ubuntu-latest | |
needs: [test] | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Build source and wheel distributions | |
run: | | |
python -m pip install --upgrade build twine | |
python -m build | |
twine check --strict dist/* | |
- name: Publish distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} |