Merge pull request #12811 from learningequality/rtibbles-patch-2 #6
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: Static dependencies with and without C extensions | |
on: | |
push: | |
branches: | |
- develop | |
- 'release-v**' | |
pull_request: | |
branches: | |
- develop | |
- 'release-v**' | |
jobs: | |
pre_job: | |
name: Path match check | |
runs-on: ubuntu-latest | |
# Map a step output to a job output | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@master | |
with: | |
github_token: ${{ github.token }} | |
paths: '["**.py", "requirements/base.txt", "requirements/build.txt"]' | |
c_ext: | |
name: C Extensions | |
needs: pre_job | |
if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.6 | |
- name: pip cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-ext-${{ hashFiles('requirements/*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip-ext | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements/base.txt | |
pip install -r requirements/build.txt | |
pip install -r requirements/test.txt | |
- name: Check C extensions build and run | |
run: | | |
# Ensure that for this Python version, we can actually compile ALL files | |
# in the kolibri directory | |
python -m compileall -q kolibri -x py2only | |
# Until we have staged builds, we will be running this in each and every | |
# environment even though builds should be done in Py 3.6 | |
make staticdeps | |
make staticdeps-cext | |
pip install . | |
# Start and stop kolibri | |
kolibri start --port=8081 | |
kolibri stop | |
# Run just tests in test/ | |
py.test --color=no test/ | |
no_c_ext: | |
name: No C Extensions | |
needs: pre_job | |
if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.6 | |
- name: pip cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-no-ext-${{ hashFiles('requirements/*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip-no-ext | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements/base.txt | |
pip install -r requirements/build.txt | |
pip install -r requirements/test.txt | |
- name: Check No C extensions build and run | |
run: | | |
# Ensure that for this Python version, we can actually compile ALL files | |
# in the kolibri directory | |
python -m compileall -q kolibri -x py2only | |
# Until we have staged builds, we will be running this in each and every | |
# environment even though builds should be done in Py 3.6 | |
make staticdeps | |
pip install . | |
# Start and stop kolibri | |
kolibri start --port=8081 | |
kolibri stop | |
# Run just tests in test/ | |
py.test --color=no test/ |