Skip to content

Commit e8eac91

Browse files
committed
chore: Update Python version for tests to 3.11 & 3.12
From just 3.8
1 parent e64b602 commit e8eac91

File tree

2 files changed

+51
-14
lines changed

2 files changed

+51
-14
lines changed

.github/workflows/ci.yml

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,56 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
tests:
11-
runs-on: ubuntu-latest
12-
steps:
13-
14-
- uses: actions/checkout@v3
10+
run_tests:
11+
name: tests
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ ubuntu-20.04 ]
16+
python-version: [ '3.11','3.12' ]
17+
toxenv: [ quality, docs, pytest ]
18+
permissions:
19+
# Gives the action the necessary permissions for publishing new
20+
# comments in pull requests.
21+
pull-requests: write
22+
# Gives the action the necessary permissions for pushing data to the
23+
# python-coverage-comment-action branch, and for editing existing
24+
# comments (to avoid publishing multiple comments in the same PR)
25+
contents: write
1526

16-
- name: Set up Python
17-
uses: actions/setup-python@v4
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: setup python
30+
uses: actions/setup-python@v5
1831
with:
19-
python-version: 3.8
32+
python-version: ${{ matrix.python-version }}
33+
34+
- name: Install pip
35+
run: pip install -r requirements/pip.txt
2036

21-
- name: Install development dependencies
22-
run: make requirements
37+
- name: Install Dependencies
38+
run: pip install -r requirements/ci.txt
2339

24-
- name: Tests
40+
- name: Run Tests
41+
env:
42+
TOXENV: ${{ matrix.toxenv }}
2543
run: tox
44+
45+
- name: Run coverage
46+
if: matrix.python-version == '3.11' && matrix.toxenv == 'django42'
47+
uses: py-cov-action/python-coverage-comment-action@v3
48+
with:
49+
GITHUB_TOKEN: ${{ github.token }}
50+
MINIMUM_GREEN: 90
51+
MINIMUM_ORANGE: 85
52+
ANNOTATE_MISSING_LINES: true
53+
ANNOTATION_TYPE: error
54+
55+
- name: Store Pull Request comment to be posted
56+
uses: actions/upload-artifact@v4
57+
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
58+
with:
59+
# If you use a different name, update COMMENT_ARTIFACT_NAME accordingly
60+
name: python-coverage-comment-action
61+
# If you use a different name, update COMMENT_FILENAME accordingly
62+
path: python-coverage-comment-action.txt

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{38}
2+
envlist = py{311,312}
33

44
[doc8]
55
; D001 = Line too long
@@ -36,14 +36,14 @@ ignore = D101,D105,D107,D200,D203,D212,D215,D404,D405,D406,D407,D408,D409,D410,D
3636

3737

3838
[pytest]
39-
addopts = --cov xapi_db_load --cov-report term-missing --cov-report xml
39+
addopts = --cov xapi_db_load --cov-report term-missing --cov-report xml --log-level=INFO
4040
norecursedirs = .* docs requirements site-packages
4141

4242
[testenv]
4343
deps =
4444
-r{toxinidir}/requirements/test.txt
4545
commands =
46-
pytest --cov xapi_db_load --cov-report term-missing --cov-report xml
46+
pytest {posargs} --full-trace
4747

4848
[testenv:docs]
4949
setenv =

0 commit comments

Comments
 (0)