Prettier README #59
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: Validation | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, edited] | |
push: | |
branches: | |
- develop | |
tags: | |
- "*" | |
jobs: | |
tests: | |
name: Run tests | |
runs-on: ubuntu-latest | |
services: | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
strategy: | |
matrix: | |
python-version: | |
- { version: "3.10", package: true } | |
- { version: "3.11", package: false } | |
- { version: "3.12", package: false } | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version.version }} | |
- name: Setup uv | |
uses: yezz123/setup-uv@v4 | |
- name: Setup Poetry | |
run: uv pip install --system poetry poetry-dynamic-versioning | |
- name: Install dependencies | |
run: make sync | |
- name: Run Pytest | |
run: make test | |
- name: Build package | |
run: poetry build | |
- name: Upload dist | |
if: matrix.python-version.package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: bernard | |
path: dist/ | |
if-no-files-found: error | |
- name: Configure Pypi publication | |
if: matrix.python-version.package && github.ref_type == 'tag' | |
run: poetry config pypi-token.pypi $PYPI_TOKEN | |
env: | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
- name: Publish package | |
if: matrix.python-version.package && github.ref_type == 'tag' | |
run: poetry publish |