Skip to content

Merge pull request #148 from codersforcauses/dependabot/npm_and_yarn/… #493

Merge pull request #148 from codersforcauses/dependabot/npm_and_yarn/…

Merge pull request #148 from codersforcauses/dependabot/npm_and_yarn/… #493

Workflow file for this run

name: Backend code checks
on:
push:
branches: [main]
pull_request:
types: ["opened", "synchronize", "reopened", "edited"]
workflow_dispatch:
jobs:
lint:
name: Run Flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: "Install flake8"
run: pip install flake8
- name: "Install flake8-django"
run: pip install flake8-django
- name: "Run flake8"
uses: liskin/gh-problem-matcher-wrap@v1
with:
linters: flake8
run: flake8 --max-line-length 150 server/
build:
name: Build and test
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python Env
uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: "poetry"
- name: Install dependencies 👨🏻‍💻
run: poetry install
- name: Run Migrations 🕊️
env:
EMAIL_PORT: 1025
FRONTEND_URL: http://localhost:3000
API_ALLOWED_HOSTS: localhost
run: poetry run python manage.py migrate
- name: Run tests 🧪
env:
API_SECRET_KEY: o!v%_v0zjvc5+_)e!r+o!_uefr2a&)lfgv17$ex=a!ei%!y-_o
JWT_SIGNING_KEY: NjMgNmYgNmQgNmQgNzUgNmUgNjkgNzQgNzkgNzMgNzAgNjkgNzIgNjkgNzQgNjYgNmYgNzUgNmUgNjQgNjEgNzQgNjkgNmYgNmU=
EMAIL_PORT: 1025
FRONTEND_URL: http://localhost:3000
API_ALLOWED_HOSTS: localhost
run: |
poetry run python3 -m pip install coverage
poetry run coverage run manage.py test
poetry run coverage xml
- name: Upload Coverage ☂️
uses: codecov/codecov-action@v3
with:
flags: backend
files: ./server/coverage.xml