Skip to content

Commit

Permalink
Add backend workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dsbilling committed Dec 28, 2024
1 parent 7b37f5c commit 84ece56
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "LANMS - Backend"

on:
pull_request:
types:
- synchronize
- opened
paths:
- 'backend/**'

jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
strategy:
matrix:
python-version: [ "3.11" ]
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install All Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run Ruff
run: ruff check --output-format=github
- name: Run Migrations
run: |
eval $(grep -m 4 'export' README.md | tail -n 4)
export ENV=test
export SQLALCHEMY_DATABASE_URI=postgresql://postgres:postgres@localhost:5432/postgres
alembic upgrade head
- name: Check for vulnerabilities
uses: pypa/[email protected]
with:
inputs: backend/requirements.txt backend/requirements-dev.txt

0 comments on commit 84ece56

Please sign in to comment.