Release:v0.2.3 #55
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: CI - Linting and Testing | |
on: | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
requirements: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./portal | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install --no-root | |
- name: Validate requirements | |
run: poetry check | |
ruff: | |
needs: requirements | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./portal | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install --no-root --only dev | |
- name: Format code | |
run: | | |
poetry run ruff format . | |
- name: Lint code | |
run: | | |
poetry run ruff check . | |
tests: | |
needs: requirements | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./portal | |
services: | |
postgres: | |
image: postgres:14.5 | |
# Provide the password for postgres which matches backend config | |
env: | |
POSTGRES_DB: portal | |
POSTGRES_USER: portal | |
POSTGRES_PASSWORD: portal | |
ports: | |
- 5432:5432 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install | |
- name: Run tests | |
run: | | |
cp ci.env .env | |
poetry run pytest |