Docs tweaks and improvements #7444
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: Server | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
linters: | |
name: "Server: Linters 📝" | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.12"] | |
poetry-version: ["1.6.1"] | |
os: [ubuntu-22.04] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "poetry" | |
- name: 🔧 poetry install | |
working-directory: ./server | |
run: poetry install --no-root | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
server/.mypy_cache | |
key: mypy-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.poetry-version }}-${{ github.sha }} | |
restore-keys: | | |
mypy-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.poetry-version }}- | |
mypy-${{ runner.os }}-${{ matrix.python-version }}- | |
mypy-${{ runner.os }}- | |
mypy- | |
- name: 🐶 Lint Server (ruff) | |
working-directory: ./server | |
run: poetry run task lint_check | |
- name: 🛟 Type Check Server (mypy) | |
working-directory: ./server | |
run: poetry run task lint_types | |
test: | |
name: "Server: Tests 🐍" | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.12"] | |
poetry-version: ["1.6.1"] | |
os: [ubuntu-22.04] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 15 | |
services: | |
postgres: | |
image: postgres:15.1-bullseye | |
env: | |
POSTGRES_USER: polar | |
POSTGRES_PASSWORD: polar | |
POSTGRES_DB: polar_test | |
POSTGRES_PORT: 5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
redis: | |
image: redislabs/redismod | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 | |
minio: | |
image: bitnami/minio:2024.5.28 | |
ports: | |
- 9000:9000 | |
- 9001:9001 | |
env: | |
MINIO_ROOT_USER: polar | |
MINIO_ROOT_PASSWORD: polarpolar | |
options: >- | |
--health-cmd "curl -I http://127.0.0.1:9000/minio/health/live" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 💿 MinIO Setup | |
working-directory: ./server/.minio | |
env: | |
MINIO_HOST: 127.0.0.1 | |
MINIO_ROOT_USER: polar | |
MINIO_ROOT_PASSWORD: polarpolar | |
ACCESS_KEY: polar-development | |
SECRET_ACCESS_KEY: polar123456789 | |
BUCKET_NAME: polar-s3 | |
BUCKET_TESTING_NAME: testing-polar-s3 | |
POLICY_FILE: policy.json | |
run: bash github.sh | |
- name: Install poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "poetry" | |
- name: 🔧 poetry install | |
working-directory: ./server | |
run: | | |
poetry install --no-root | |
poetry run task generate_dev_jwks | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
server/.pytest_cache | |
key: pytest-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.poetry-version }}-${{ github.sha }} | |
restore-keys: | | |
pytest-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.poetry-version }}- | |
pytest-${{ runner.os }}-${{ matrix.python-version }}- | |
pytest-${{ runner.os }}- | |
pytest- | |
- name: ⚗️ alembic migrate | |
working-directory: ./server | |
env: | |
POLAR_ENV: testing | |
run: poetry run task db_migrate | |
- name: ⚗️ alembic check | |
working-directory: ./server | |
env: | |
POLAR_ENV: testing | |
run: poetry run alembic check | |
- name: 🐍 Run tests (pytest) | |
working-directory: ./server | |
run: poetry run pytest |