Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/monorepo-production-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Monorepo Production Tests

on:
push:
branches:
- main
- master

jobs:
setup-install:
name: Install all dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"

- name: Install root and frontend dependencies
run: npm install --workspaces

- name: Setup Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install backend Python dependencies
working-directory: ./backend
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

frontend-build-start:
name: Build and start frontend for production test
runs-on: ubuntu-latest
needs: setup-install
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"

- name: Install dependencies (frontend)
working-directory: ./frontend
run: npm install

- name: Build frontend production
working-directory: ./frontend
run: npm run build

- name: Start frontend app and test
working-directory: ./frontend
run: |
npm run start & # start frontend in background
sleep 10 # wait for app to initialize
kill $! # stop the app

backend-test-lint:
name: Run backend lint and tests
runs-on: ubuntu-latest
needs: setup-install
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install backend dependencies
working-directory: ./backend
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run backend lint checks
working-directory: ./backend
run: |
black . --check
isort . --check-only
flake8 .

- name: Run backend tests
working-directory: ./backend
run: pytest