Skip to content

Commit b82703f

Browse files
authored
Add support github-action python2.7 by the use of a container (#367)
* Add support github-action python2.7 by the use of a container See actions/runner-images#7401 (comment)
1 parent 918b4bb commit b82703f

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

.github/workflows/python-package.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,20 @@ on:
1212
- master
1313

1414
jobs:
15-
test:
15+
test_py3:
1616
runs-on: ubuntu-20.04
1717
strategy:
1818
fail-fast: false
1919
matrix:
2020
python-version:
21-
- "2.7"
2221
- "3.5"
2322
- "3.6"
2423
- "3.7"
2524
- "3.8"
2625
- "3.9"
2726
- "3.10"
2827
steps:
29-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v3
3029
- name: Set up Python ${{ matrix.python-version }}
3130
uses: actions/setup-python@v2
3231
with:
@@ -46,11 +45,34 @@ jobs:
4645
make install-test
4746
- name: Test
4847
run: make pytest
48+
test_py2:
49+
runs-on: ubuntu-20.04
50+
container:
51+
image: python:2.7.18-buster
52+
strategy:
53+
fail-fast: false
54+
steps:
55+
- uses: actions/checkout@v3
56+
- uses: actions/cache@v2
57+
with:
58+
path: ~/.cache/pip
59+
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
60+
restore-keys: |
61+
${{ runner.os }}-pip-
62+
- name: Install dependencies
63+
run: |
64+
pip install -U setuptools
65+
apt-get update -qq
66+
apt-get install -qq swig python-dev libxml2-dev libxmlsec1-dev
67+
make install-req
68+
make install-test
69+
- name: Test
70+
run: make pytest
4971
lint:
5072
runs-on: ubuntu-20.04
5173
environment: CI
5274
steps:
53-
- uses: actions/checkout@v2
75+
- uses: actions/checkout@v3
5476
- uses: actions/setup-python@v2
5577
with:
5678
python-version: "3.10"

0 commit comments

Comments
 (0)