-
Notifications
You must be signed in to change notification settings - Fork 7
45 lines (39 loc) · 1.33 KB
/
ci.yaml
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
name: Build
on:
push:
branches:
- main # Run on pushes to main
pull_request: # Run on pull requests
jobs:
CI:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements-developer.txt
- name: Build coverage file
run: |
set -e
echo before: $?
python -m pytest tests/
echo exit_code btw: $?
pytest -n auto --junitxml=pytest.xml --cov-report=term-missing --cov=choice_learn tests/ | tee pytest-coverage.txt
echo exit_code: $?
cat pytest-coverage.txt
- name: Pytest coverage comment
uses: VincentAuriau/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
issue-number: ${{ github.event.pull_request.number || '101' }}
unique-id-for-comment: ${{ matrix.python-version }}
title: 'Coverage Report for Python ${{ matrix.python-version }}'