Skip to content

Install ruff as dev dependency #350

Install ruff as dev dependency

Install ruff as dev dependency #350

Workflow file for this run

name: Unit Tests
on:
push:
pull_request:
branches:
- master
- dev
jobs:
test-backend:
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
working-directory: backend
env:
SECRET_KEY: github_actions
services:
postgres:
image: postgres:14.0
env:
POSTGRES_DB: github_actions
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Setup Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: psycopg2 prerequisites
run: sudo apt-get install libpq-dev
- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- id: cache-pipenv
uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install --deploy --dev
- name: Django tests
run: |
pipenv run coverage run manage.py test
- name: Code coverage
run: |
pipenv run coverage report -m
test-frontend:
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
working-directory: frontend
strategy:
matrix:
node: [ 16 ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: |
npm install
- name: Run unit tests
run: |
npm test
- name: Run coverage
run: |
npm run coverage