style(all): fixing pipelines #3128
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_lint: | |
name: Backend Pylint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out repository | |
uses: actions/checkout@v4 | |
- name: Install deps | |
uses: ./.github/actions/setup-ci-backend | |
- name: Install pylint | |
run: pip install pylint | |
- name: Analysing the code with pylint | |
run: pylint $(git ls-files '*.py') | |
backend_typecheck: | |
name: Backend Mypy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out repository | |
uses: actions/checkout@v4 | |
- name: Install deps | |
uses: ./.github/actions/setup-ci-backend | |
- name: Run mypy checks | |
run: python -m mypy . | |
working-directory: ./backend | |
backend_tests: | |
name: Backend Unit Tests | |
runs-on: ubuntu-latest | |
if: false | |
permissions: # required for artifacts | |
checks: write | |
pull-requests: write | |
steps: | |
- name: Checking out repository | |
uses: actions/checkout@v4 | |
- name: Install deps | |
uses: ./.github/actions/setup-ci-backend | |
- name: Setup environment | |
uses: ./.github/actions/setup-ci-env | |
- name: Run the backend container | |
run: docker compose up -d ci-backend | |
- name: Wait for backend to initialise # cringe as hell, remove when we get health checks to wait on | |
run: sleep 90s | |
- name: Test algorithm with pytest | |
run: | | |
pip install pytest-cov | |
python -m pytest --junitxml=junit/be-test-results.xml --cov=. --cov-report=xml --cov-report=html | |
working-directory: ./backend | |
- 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 | |
if: false | |
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 | |