Skip to content

Commit b36e475

Browse files
Copilotecarreras
andcommitted
Use container for Python 2.7 instead of setup-python action
Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com>
1 parent a26005f commit b36e475

File tree

1 file changed

+37
-8
lines changed

1 file changed

+37
-8
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,50 @@ on:
77
branches: [ master ]
88

99
jobs:
10-
test:
10+
test-python27:
1111
runs-on: ubuntu-latest
12+
container: python:2.7-slim
1213
permissions:
1314
contents: read
14-
strategy:
15-
matrix:
16-
python-version: ['2.7', '3.11']
1715

1816
steps:
1917
- uses: actions/checkout@v4
2018

21-
- name: Set up Python ${{ matrix.python-version }}
19+
- name: Install dependencies
20+
run: |
21+
pip install .
22+
pip install coveralls
23+
24+
- name: Run tests with coverage
25+
run: |
26+
coverage run setup.py test
27+
28+
- name: Upload coverage to Coveralls
29+
if: success()
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
COVERALLS_FLAG_NAME: python-2.7
33+
COVERALLS_PARALLEL: true
34+
run: |
35+
coveralls --service=github
36+
37+
- name: Generate coverage report
38+
if: success()
39+
run: |
40+
coverage report
41+
42+
test-python311:
43+
runs-on: ubuntu-latest
44+
permissions:
45+
contents: read
46+
47+
steps:
48+
- uses: actions/checkout@v4
49+
50+
- name: Set up Python 3.11
2251
uses: actions/setup-python@v5
2352
with:
24-
python-version: ${{ matrix.python-version }}
53+
python-version: '3.11'
2554

2655
- name: Install dependencies
2756
run: |
@@ -36,7 +65,7 @@ jobs:
3665
if: success()
3766
env:
3867
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39-
COVERALLS_FLAG_NAME: python-${{ matrix.python-version }}
68+
COVERALLS_FLAG_NAME: python-3.11
4069
COVERALLS_PARALLEL: true
4170
run: |
4271
coveralls --service=github
@@ -47,7 +76,7 @@ jobs:
4776
coverage report
4877
4978
coveralls-finish:
50-
needs: test
79+
needs: [test-python27, test-python311]
5180
runs-on: ubuntu-latest
5281
permissions:
5382
contents: read

0 commit comments

Comments
 (0)