Skip to content

feat: integration test suite for Judge0 harness pipeline #503

feat: integration test suite for Judge0 harness pipeline

feat: integration test suite for Judge0 harness pipeline #503

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: true
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
run: |
pip install -r backend/requirements.txt
pip install -r backend/requirements-test.txt
- name: Lint
run: ruff check backend/
- name: Test
run: pytest backend/tests/
env:
SECRET_KEY: ci-test-secret
frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
cache: yarn
cache-dependency-path: frontend/yarn.lock
- name: Install
working-directory: frontend
run: yarn install --frozen-lockfile
- name: Lint
working-directory: frontend
run: yarn lint
- name: Test
working-directory: frontend
run: yarn test
docker:
runs-on: ubuntu-latest
needs: [backend, frontend]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Set short SHA
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> "$GITHUB_ENV"
- name: Lowercase owner
run: echo "OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v4
- name: Build and push backend
uses: docker/build-push-action@v7
with:
context: ./backend
push: true
tags: |
ghcr.io/${{ env.OWNER }}/dsa-flash-backend:latest
ghcr.io/${{ env.OWNER }}/dsa-flash-backend:sha-${{ env.SHORT_SHA }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push frontend
uses: docker/build-push-action@v7
with:
context: ./frontend
push: true
tags: |
ghcr.io/${{ env.OWNER }}/dsa-flash-frontend:latest
ghcr.io/${{ env.OWNER }}/dsa-flash-frontend:sha-${{ env.SHORT_SHA }}
cache-from: type=gha
cache-to: type=gha,mode=max