forked from exasol/bucketfs-utils-python
-
Notifications
You must be signed in to change notification settings - Fork 1
156 lines (126 loc) · 4.39 KB
/
checks.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Checks
on:
workflow_call:
secrets:
ALTERNATIVE_GITHUB_TOKEN:
required: false
jobs:
Version-Check:
name: Version
runs-on: ubuntu-latest
steps:
- name: SCM Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
- name: Check Version(s)
run: poetry run version-check `poetry run python -c "from noxconfig import PROJECT_CONFIG; print(PROJECT_CONFIG.version_file)"`
echo "Please enable the version check by replacing this output with shell command bellow:"
echo ""
echo "poetry run version-check <<VERSION_PY>>"
echo ""
echo "Note: <<VERSION_PY>> needs to point to the version file of the project (version.py)."
exit 1
Documentation:
name: Docs
needs: [ Version-Check ]
runs-on: ubuntu-latest
steps:
- name: SCM Checkout
uses: actions/checkout@v4
- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
- name: Build Documentation
run: |
poetry run python -m nox -s docs:build
Lint:
name: Linting (Python-${{ matrix.python-version }})
needs: [ Version-Check ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
steps:
- name: SCM Checkout
uses: actions/checkout@v4
- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Run lint
run: poetry run nox -s lint:code
- name: Upload Artifacts
uses: actions/[email protected]
with:
name: lint-python${{ matrix.python-version }}
path: .lint.txt
include-hidden-files: true
Type-Check:
name: Type Checking (Python-${{ matrix.python-version }})
needs: [ Version-Check ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
steps:
- name: SCM Checkout
uses: actions/checkout@v4
- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Run type-check
run: poetry run nox -s lint:typing
Security:
name: Security Checks (Python-${{ matrix.python-version }})
needs: [ Version-Check ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
steps:
- name: SCM Checkout
uses: actions/checkout@v4
- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Run security linter
run: poetry run nox -s lint:security
- name: Upload Artifacts
uses: actions/[email protected]
with:
name: security-python${{ matrix.python-version }}
path: .security.json
include-hidden-files: true
Tests:
name: Tests (Python-${{ matrix.python-version }}, Exasol-${{ matrix.exasol-version}})
needs: [ Documentation, Lint, Type-Check, Security ]
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.ALTERNATIVE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
exasol-version: ["7.1.9"]
steps:
- name: SCM Checkout
uses: actions/checkout@v4
- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Run Tests and Compute Coverage
run: poetry run nox -s test:coverage -- -- --db-version ${{ matrix.exasol-version }}
- name: Upload Artifacts
uses: actions/[email protected]
with:
name: coverage-python${{ matrix.python-version }}
path: .coverage
include-hidden-files: true