-
Notifications
You must be signed in to change notification settings - Fork 6
173 lines (141 loc) · 4.63 KB
/
Copy pathgitlab-python-worflow.yml
File metadata and controls
173 lines (141 loc) · 4.63 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# This workflow handles formatting, testing, and SonarQube scanning for the PODPAC repository.
name: Python Workflow
on:
push:
branches: [main, develop]
pull_request:
types: [opened, synchronize, reopened]
jobs:
formatting:
name: Formatting
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install Dependencies
run: pip install --upgrade pip setuptools && pip install .[devall]
- name: Run Black Format Checks
run: black --version; black --check --diff -l 120 . > black-report.txt
- name: Artifact Black Report
uses: actions/upload-artifact@v4
with:
name: black-report
path: black-report.txt
retention-days: 1
- name: Run flake8 Format Checks
run: flake8 --version; flake8 --format=pylint --ignore=E,W,D,I,N806,N815,N818,Q000,Q001,Q002,S001,B008,B028 --tee --output-file=flake8-report.txt .
- name: Artifact flake8 Report
uses: actions/upload-artifact@v4
with:
name: flake8-report
path: flake8-report.txt
retention-days: 1
unit-testing:
name: Unit Testing
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install Dependencies
run: |
pip install --upgrade pip setuptools && pip install .[devall]
- name: Run Pytest with Coverage
run: |
coverage run --branch \
-m pytest -m "not integration" --continue-on-collection-errors || \
{ echo "WARNING: Some tests have failed. (Temporarily ignored)"; true; }
coverage xml -o coverage.xml
sed -i 's,<source>.*/podpac</source>,<source>podpac</source>,' coverage.xml
- name: Artifact Coverage Document
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.xml
retention-days: 1
zarr-compat-testing:
name: Zarr Compatibility Testing
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
zarr-version: ["zarr>=2.3,<3", "zarr>=3,<4"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install Dependencies
run: |
pip install --upgrade pip setuptools && pip install .[devall]
pip install "${{ matrix.zarr-version }}" "numcodecs>=0.15.1"
- name: Run Zarr Tests
run: |
pytest podpac/core/data/test/test_zarr.py podpac/core/data/test/test_zarr_compat.py \
podpac/core/cache/test/test_node_caches.py podpac/core/managers/test/test_parallel.py \
-m "not integration"
document-testing:
name: Document Testing
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
path: podpac
- name: Checkout Examples Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: "creare-com/podpac-examples"
path: podpac-examples
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install Dependencies
run: |
pip install --upgrade pip setuptools && cd podpac && pip install .[devall]
- name: Run doc tests
run: |
cd podpac/doc && ./test-docs.sh && cd ../.. || \
{ echo "WARNING: Some document tests have failed. (Temporarily ignored)"; true; }
- name: Artifact Doctest Document
uses: actions/upload-artifact@v4
with:
name: doctest
path: podpac/build/output.txt
retention-days: 1
sonarqube_scan:
name: SonarQube Scan
needs: [unit-testing]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Download Coverage Artifact
uses: actions/download-artifact@v4
with:
name: coverage
path: .
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}