-
Notifications
You must be signed in to change notification settings - Fork 668
100 lines (98 loc) · 3.26 KB
/
c_extensions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
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
coverage run -p kolibri start --port=8081
coverage run -p kolibri stop
# Run just tests in test/
py.test --cov=kolibri --cov-report= --cov-append --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
coverage run -p kolibri start --port=8081
coverage run -p kolibri stop
# Run just tests in test/
py.test --cov=kolibri --cov-report= --cov-append --color=no test/