-
Notifications
You must be signed in to change notification settings - Fork 1
138 lines (132 loc) · 4.41 KB
/
test.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python Tests
on:
push:
branches:
- main
- 'release/**'
pull_request:
branches:
- main
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 14
strategy:
fail-fast: false
matrix:
name:
[
# latest conan 1.X on U20 and Windows
"ubuntu20-py38-conan1",
"ubuntu20-py39-conan1",
"ubuntu20-py310-conan1",
"ubuntu20-py311-conan1",
"ubuntu22-py312-conan1",
"windows-py311-conan1",
# conan 2 stuff - for Python 3.12 (U22 needed)
"ubuntu20-py310-conan2",
"ubuntu22-py312-conan2",
"windows-py312-conan2",
]
include:
- name: "ubuntu20-py38-conan1"
python: "3.8"
os: ubuntu-20.04
conan: "1"
- name: "ubuntu20-py39-conan1"
python: "3.9"
conan: "1"
os: ubuntu-20.04
- name: "ubuntu20-py310-conan1"
python: "3.10"
conan: "1"
os: ubuntu-20.04
- name: "ubuntu20-py311-conan1"
python: "3.10"
conan: "1"
os: ubuntu-20.04
- name: "ubuntu22-py312-conan1"
python: "3.10"
conan: "1"
os: ubuntu-20.04
- name: "windows-py311-conan1"
python: "3.11"
os: windows-latest
conan: "1"
- name: "ubuntu20-py310-conan2"
python: "3.10"
os: ubuntu-22.04
conan: "2"
- name: "ubuntu22-py312-conan2"
python: "3.12"
os: ubuntu-22.04
conan: "2"
- name: windows-py312-conan2
python: "3.12"
os: windows-latest
conan: "2"
env:
DISPLAY: ":99.0"
LC_ALL: "en_US.UTF-8"
CAL_DEBUG_LEVEL: 2
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip' # caching pip dependencies
cache-dependency-path: setup.py
- name: Install specific Conan version
run: | # markupsafe is a workaround fix for broken conan dependencies
pip install markupsafe==2.0.1 --use-pep517
pip install "conan~=${{ matrix.conan }}.0" --use-pep517
- name: Install own package and test dependencies
# need -e because of coverage paths.
run: |
pip install -e .[test]
env:
CONAN_VERSION: ${{ matrix.conan}}
- name: Execute unitests with pytest
run: >-
python script/execute_tests.py --conan_major_version=${{ matrix.conan }}
- name: Upload Test results
uses: actions/upload-artifact@v3 # TODO: v4 does not support overwrite anymore
with:
name: Test results
path: |
cov/
results/
sonarcloud:
if: always() # execute, even when tests fail
needs:
- test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting,
# cf https://sonarcloud.io/project/configuration?analysisMode=GitHubActions
fetch-depth: 0
- uses: actions/download-artifact@v3
with:
name: Test results
path: ./
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=goszpeti
-Dsonar.projectKey=goszpeti_conan_unified_api
-Dsonar.sources=./conan_unified_api
-Dsonar.tests=./test
-Dsonar.sourceEncoding=UTF-8
-Dsonar.python.version=3.8,3.9,3.10,3.11,3.12
-Dsonar.python.coverage.reportPaths=cov/cov-*.xml
-Dsonar.python.xunit.reportPath=results/result-unit-*.xml