Skip to content

Merge pull request #122 from orangespaceman/lm/improve-valid-result-l… #108

Merge pull request #122 from orangespaceman/lm/improve-valid-result-l…

Merge pull request #122 from orangespaceman/lm/improve-valid-result-l… #108

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "21"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
node_modules
venv
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/requirements/ci.txt') }}
restore-keys: |
${{ runner.os }}-build-
- name: Install dependencies
run: |
npm install
python -m venv venv
source venv/bin/activate
pip install -r requirements/ci.txt
- name: Build frontend
run: npm run build
- name: Lint frontend
run: npm run lint
- name: Lint backend
run: |
source venv/bin/activate
cd phx
isort --check-only --quiet --recursive --diff phx
yapf --diff --recursive phx
flake8
- name: Test backend
run: |
source venv/bin/activate
cp .env.ci.example .env
cd phx && python manage.py test --settings=phx.settings.ci
services:
postgres:
image: postgres:13.8
env:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpw
POSTGRES_DB: testdb
ports:
- 5432:5432