Merge pull request #975 from irtazaakram/django52 #259
This file contains hidden or 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 | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['py311', 'py312'] | |
| env-name: ['django42','django52', 'quality'] | |
| db-version: ['mysql80'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Start container | |
| run: | | |
| docker compose -f .github/docker-compose-ci.yml up -d | |
| - name: Setup Python ${{ matrix.python-version }} inside container | |
| run: | | |
| PY_VER=$(if [ "${{ matrix.python-version }}" = "py312" ]; then echo "3.12"; else echo "3.11"; fi) | |
| docker exec xqueue bash -c " | |
| apt update && | |
| apt install -y software-properties-common curl && | |
| add-apt-repository ppa:deadsnakes/ppa -y && | |
| apt install -y python$PY_VER python$PY_VER-dev python$PY_VER-venv && | |
| update-alternatives --install /usr/bin/python3 python3 /usr/bin/python$PY_VER 1 && | |
| python$PY_VER -m venv /tmp/venv && | |
| /tmp/venv/bin/pip install --upgrade pip | |
| " | |
| - name: Install test dependencies and run tests | |
| env: | |
| TOXENV: ${{ matrix.python-version }}-${{ matrix.env-name }} | |
| run: | | |
| docker exec xqueue bash -c "cd /edx/app/xqueue/xqueue/; /tmp/venv/bin/pip install -r requirements/ci.txt" | |
| docker exec xqueue bash -c "cd /edx/app/xqueue/xqueue/ && DB_HOST=${{ matrix.db-version }} tox -e ${TOXENV}" |