Skip to content

Python Requirements Update #143

Python Requirements Update

Python Requirements Update #143

name: Integration Tests
on:
pull_request:
push:
branches: [main]
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
tests:
name: ${{ matrix.edx-platform.branch }} (${{ matrix.edx-platform.release }})
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
edx-platform:
- branch: opencraft-release/nutmeg.2
remote: open-craft
release: nutmeg
python-version: 3.8
- branch: opencraft-release/palm.1
remote: open-craft
release: palm
python-version: 3.8
- branch: opencraft-release/quince.1
remote: open-craft
release: quince
python-version: 3.8
- branch: opencraft-release/redwood.1
remote: open-craft
release: redwood
python-version: 3.11
- branch: master
remote: openedx
release: master
python-version: 3.11
env:
EDX_PLATFORM_PATH: ./edx/app/edxapp/edx-platform
SECTION_TO_COURSE_PATH: ./edx/src/section-to-course
steps:
- name: Create directory structure
run: mkdir -p ${{ env.EDX_PLATFORM_PATH }} ${{ env.SECTION_TO_COURSE_PATH }}
- name: Checkout edx-platform repository
uses: actions/checkout@v3
with:
repository: ${{ matrix.edx-platform.remote }}/edx-platform
ref: ${{ matrix.edx-platform.branch }}
path: ${{ env.EDX_PLATFORM_PATH }}
- name: install edx-platform required packages
run: sudo apt-get update && sudo apt-get install libxmlsec1-dev lynx
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 4.4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.edx-platform.python-version }}
- name: Get pip cache dir
id: pip-cache-dir
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache pip dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache-dir.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/testing.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install edx-platform required Python dependencies
env:
PIP_SRC: ${{ runner.temp }}
working-directory: ${{ env.EDX_PLATFORM_PATH }}
run: |
if [[ "${{ matrix.edx-platform.release }}" == "nutmeg" ]]; then
pip install -r requirements/pip.txt
pip install -r requirements/edx/development.txt --src ${{ runner.temp }}
else
make test-requirements
fi
- name: Checkout section-to-course repo
uses: actions/checkout@v3
with:
path: ${{ env.SECTION_TO_COURSE_PATH }}
- name: Install section-to-course
working-directory: ${{ env.SECTION_TO_COURSE_PATH }}
run: pip install -e .
- name: Run section-to-course integration tests
working-directory: ${{ env.SECTION_TO_COURSE_PATH }}
run: make test_integration
- name: Run coverage
if: matrix.edx-platform.branch == 'opencraft-release/nutmeg.2'
uses: codecov/codecov-action@v3
with:
working-directory: ${{ env.SECTION_TO_COURSE_PATH }}
token: ${{ secrets.CODECOV_TOKEN }}
flags: integration
fail_ci_if_error: true