-
Notifications
You must be signed in to change notification settings - Fork 3
88 lines (71 loc) · 2.03 KB
/
ci.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
---
name: CI
on: # yamllint disable-line rule:truthy
push:
branches:
- main
tags:
- v*.*.*
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python_version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
steps:
- name: Checkout the repository
uses: actions/[email protected]
- name: Setup Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox-gh-actions
- name: Run tox
env:
COVERAGE_FILE: .coverage.${{ matrix.python_version }}
run: tox
- name: Store the coverage report
uses: actions/[email protected]
with:
include-hidden-files: true
name: coverage-${{ matrix.python_version }}
path: .coverage.${{ matrix.python_version }}
coverage:
runs-on: ubuntu-latest
needs: build
permissions:
pull-requests: write
contents: write
steps:
- name: Checkout the repository
uses: actions/[email protected]
- name: Retrieve the coverage reports
id: download
uses: actions/[email protected]
with:
pattern: coverage-*
merge-multiple: true
- name: Process the coverage reports
id: coverage_processing
uses: py-cov-action/[email protected]
with:
COVERAGE_DATA_BRANCH: 'COVERAGE-REPORT'
GITHUB_TOKEN: ${{ github.token }}
MERGE_COVERAGE_FILES: true
- name: Store the pull request coverage comment for later posting
if: steps.coverage_processing.outputs.COMMENT_FILE_WRITTEN == 'true'
uses: actions/[email protected]
with:
name: python-coverage-comment-action
path: python-coverage-comment-action.txt