Skip to content

feat: modernize to uv + pyproject.toml + src/ layout + python-semantic-release #448

feat: modernize to uv + pyproject.toml + src/ layout + python-semantic-release

feat: modernize to uv + pyproject.toml + src/ layout + python-semantic-release #448

Workflow file for this run

name: codejail-ci
on:
push:
branches:
- master
pull_request:
# Allow this workflow to be called from other workflows
workflow_call:
jobs:
quality:
name: quality
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: true
python-version: "3.12"
- name: Install CI dependencies
run: uv sync --group ci
- name: Run quality checks
run: uv run tox -e quality
tests:
name: ${{ matrix.toxenv }}
runs-on: ubuntu-${{ matrix.ubuntu_version }}
strategy:
fail-fast: false
matrix:
python_version: ['3.12']
ubuntu_version: ['22.04', '24.04']
toxenv: ['django42', 'django52']
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Parse custom apparmor profile with ABI 3.0
run: sudo apparmor_parser -r -W apparmor-profiles/home.sandbox.codejail_sandbox.bin.python-abi3
- name: Build latest code changes into CI image
run: |
docker build -t openedx-codejail \
--cache-to type=gha \
--cache-from type=gha \
--build-arg python_version=${{ matrix.python_version }} \
--build-arg ubuntu_version=${{ matrix.ubuntu_version }} .
- name: Run container with custom apparmor profile and codejail CI image
run: |
docker run --name=codejail --privileged -d --security-opt apparmor=openedx_codejail_sandbox \
openedx-codejail tail -f /dev/null
- name: Run Tests
run: docker exec -e TOXENV=${{ matrix.toxenv }} -t codejail bash -c 'tox'