Skip to content

style(all): fixing pipelines #3120

style(all): fixing pipelines

style(all): fixing pipelines #3120

Workflow file for this run

name: CI tests
on:
pull_request:
branches: [dev, main, 331-staging]
jobs:
event_file:
name: Event File
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Event File
path: ${{ github.event_path }}
backend:
name: Backend CI Testing
runs-on: ubuntu-latest
if: false
permissions:
checks: write
pull-requests: write
steps:
- name: Checking out repository
uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r backend/requirements.txt
- name: Set up env
run: >
python3
setup_env.py
--default
--sessionsdb_username="github_ci"
--sessionsdb_password="github_ci"
--sessionsdb_service_hostname="sessionsdb"
--mongodb_username="github_ci"
--mongodb_password="github_ci"
--mongodb_service_hostname="mongodb"
- name: Run the backend container
run: docker compose up -d ci-backend
- name: Run mypy checks
run: cd backend && python -m mypy . && cd ..
- name: Test algorithm with pytest
run: |
cd backend
pip install pytest-cov
python -m pytest --junitxml=junit/be-test-results.xml --cov=. --cov-report=xml --cov-report=html
- uses: actions/upload-artifact@v3 # upload test results
if: always()
with:
name: be-test-results
path: backend/junit/be-test-results.xml # Path to test results
frontend_lint:
name: Frontend Eslint
runs-on: ubuntu-latest
steps:
- name: Checking out repository
uses: actions/checkout@v4
- name: Install deps
uses: ./.github/actions/setup-ci-frontend
- name: Run eslint on frontend
run: ls && npm run lint
working-directory: ./frontend
frontend_typecheck:
name: Frontend Typechecks
runs-on: ubuntu-latest
steps:
- name: Checking out repository
uses: actions/checkout@v4
- name: Install deps
uses: ./.github/actions/setup-ci-frontend
- name: Typecheck the frontend
run: npm run types
working-directory: ./frontend
frontend_tests:
name: Frontend Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checking out repository
uses: actions/checkout@v4
- name: Install deps
uses: ./.github/actions/setup-ci-frontend
- name: Run the unit tests on frontend
run: npm run test
working-directory: ./frontend
- uses: actions/upload-artifact@v3
if: always()
with:
name: fe-test-results
path: frontend/junit/fe-test-results.xml
docker_build:
name: Build docker containers
runs-on: ubuntu-latest
steps:
- name: Checking out repository
uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/setup-ci-env
- name: Check the backend successfully builds
run: docker compose build backend-prod
- name: Check the frontend successfully builds
run: docker compose build frontend-prod
# TODO: this doesn't really make sense until we get healthchecks setup (could also upload these artifacts)
# - name: Check that we can successfully start the containers
# run: docker compose up --wait backend-prod frontend-prod