-
Notifications
You must be signed in to change notification settings - Fork 2
139 lines (117 loc) · 3.56 KB
/
tests.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
139
name: "🎳 Tester"
on:
push:
branches:
- main
paths:
- "**/*.py"
- ".github/workflows/tests.yml"
pull_request:
branches:
- main
paths:
- "**/*.py"
- ".github/workflows/tests.yml"
- "requirements/base.txt"
- "requirements/testing.txt"
- tests/fixtures/
env:
PROJECT_FOLDER: "qgis_deployment_toolbelt"
jobs:
unit-test:
strategy:
fail-fast: false
# max-parallel: 4
matrix:
os:
- macos-latest
- ubuntu-22.04
- windows-latest
python-version:
- "3.10"
- "3.11"
- "3.12"
runs-on: ${{ matrix.os }}
steps:
- name: Get source code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "requirements/*.txt"
- name: Install project requirements
run: |
python -m pip install -U pip setuptools wheel
python -m pip install -U -r requirements.txt
python -m pip install -U -r requirements/testing.txt
- name: Install project as a package
run: python -m pip install -e .
- name: Unit tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
QDT_LOGS_LEVEL: 4
run: pytest
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
env_vars: OS,PYTHON
flags: unittests
name: Code Coverage for unittests on [${{ matrix.os }}.python-${{ matrix.python-version }}]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
integration-test:
strategy:
fail-fast: false
# max-parallel: 4
matrix:
os:
- macos-latest
- ubuntu-22.04
- windows-latest
python-version:
- "3.10"
- "3.11"
- "3.12"
runs-on: ${{ matrix.os }}
steps:
- name: Get source code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "requirements/*.txt"
- name: Install project requirements
run: |
python -m pip install -U pip setuptools wheel
python -m pip install -U -r requirements.txt
- name: Install project as a package
run: python -m pip install -e .
- name: QDT - Echoing help
run: qdt --help
- name: QDT - Echoing version
run: qdeploy-toolbelt --version
- name: QDT - Check upgrade
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required to avoid GH API rate limit
run: qdt upgrade
- name: QDT - Run sample scenario twice
run: |
qgis-deployment-toolbelt --verbose
qgis-deployment-toolbelt
- name: QDT - Run sample scenario a third time
run: qgis-deployment-toolbelt --verbose --no-logfile
- name: QDT - Export rules context
run: qdt export-rules-context -o rules_context/"${{ matrix.os }}_${{ matrix.python-version }}.json"
- name: Save Rules Context as artifact
uses: actions/upload-artifact@v4
with:
name: rules_context-${{ matrix.os }}-${{ matrix.python-version }}
path: rules_context/*.json
if-no-files-found: error
retention-days: 30