feat: new shoelace #40
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: Python application | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Install dependencies with Poetry | |
run: | | |
poetry install --with dev | |
- name: Install pre-commit | |
run: | | |
poetry run pip install pre-commit | |
- name: Run pre-commit | |
run: | | |
poetry run pre-commit run --all-files | |
- name: Install Playwright browsers | |
run: | | |
poetry run playwright install | |
- name: Run tests | |
run: | | |
poetry run pytest --reruns 3 # githubs playwright sometimes fails | |
- name: Build package | |
if: github.ref == 'refs/heads/main' | |
run: | | |
python -m pip install --upgrade build | |
python -m build | |
- name: Publish package to PyPI | |
if: github.ref == 'refs/heads/main' | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
python -m pip install --upgrade twine | |
python -m twine upload dist/* |