Skip to content

Commit ac14bfc

Browse files
authored
#252: Updated Github workflows from Exasol toolbox (#288)
fixes #252
1 parent a1b3497 commit ac14bfc

File tree

20 files changed

+1133
-632
lines changed

20 files changed

+1133
-632
lines changed

.github/workflows/release.yml renamed to .github/workflows/build-and-publish.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
name: Build & Publish
22

33
on:
4-
push:
5-
tags: '**'
4+
workflow_call:
5+
secrets:
6+
PYPI_TOKEN:
7+
required: true
68

79
jobs:
810

9-
publish-release:
11+
cd-job:
12+
name: Continuous Delivery
1013
runs-on: ubuntu-24.04
11-
environment: publish
12-
1314
steps:
1415

1516
- name: SCM Checkout
1617
uses: actions/checkout@v4
1718

1819
- name: Setup Python & Poetry Environment
19-
uses: exasol/python-toolbox/.github/actions/python-environment@0.12.0
20+
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
2021
with:
2122
python-version: '3.10'
2223
poetry-version: '2.1.2'
@@ -35,5 +36,6 @@ jobs:
3536
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3637
run: >
3738
gh release create ${GITHUB_REF_NAME}
38-
--title ${GITHUB_REF_NAME} -F "./doc/changes/changes_${GITHUB_REF_NAME}.md"
39+
--title ${GITHUB_REF_NAME}
40+
--notes-file ./doc/changes/changes_${GITHUB_REF_NAME}.md
3941
dist/*

.github/workflows/cd.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: CD
2+
3+
on:
4+
push:
5+
tags:
6+
- '**'
7+
8+
jobs:
9+
10+
check-tag-version-job:
11+
name: Check Release Tag
12+
uses: ./.github/workflows/check-release-tag.yml
13+
14+
cd-job:
15+
name: Continuous Delivery
16+
uses: ./.github/workflows/build-and-publish.yml
17+
secrets:
18+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Check Release Tag
2+
3+
on: workflow_call
4+
5+
jobs:
6+
7+
check-tag-version-job:
8+
9+
name: Check Tag Version
10+
runs-on: ubuntu-24.04
11+
12+
steps:
13+
- name: SCM Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Python & Poetry Environment
17+
uses: exasol/python-toolbox/.github/actions/[email protected]
18+
19+
- name: Check Tag Version
20+
# make sure the pushed/created tag matched the project version
21+
run: "[[ `poetry version --short` == ${{ github.ref_name }} ]]"

.github/workflows/checks.yml

Lines changed: 91 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Checks
22

33
on:
4-
pull_request:
4+
workflow_call:
55

66
jobs:
77

@@ -16,19 +16,31 @@ jobs:
1616
fetch-depth: 0
1717

1818
- name: Setup Python & Poetry Environment
19-
uses: exasol/python-toolbox/.github/actions/[email protected]
20-
with:
21-
poetry-version: 2.1.2
19+
uses: exasol/python-toolbox/.github/actions/[email protected]
2220

2321
- name: Check Version(s)
2422
run: |
25-
poetry run version-check exasol/slc/version.py
26-
23+
poetry run -- version-check exasol/slc/version.py
2724
2825
build-matrix:
2926
name: Generate Build Matrix
3027
uses: ./.github/workflows/matrix-python.yml
3128

29+
Changelog:
30+
name: Changelog Update Check
31+
runs-on: ubuntu-24.04
32+
if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' }}
33+
34+
steps:
35+
- name: SCM Checkout
36+
uses: actions/checkout@v4
37+
38+
- name: Setup Python & Poetry Environment
39+
uses: exasol/python-toolbox/.github/actions/[email protected]
40+
41+
- name: Run changelog update check
42+
run: poetry run -- nox -s changelog:updated
43+
3244
Lint:
3345
name: Linting (Python-${{ matrix.python-version }})
3446
needs: [ Version-Check, build-matrix ]
@@ -42,22 +54,20 @@ jobs:
4254
uses: actions/checkout@v4
4355

4456
- name: Setup Python & Poetry Environment
45-
uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0
57+
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
4658
with:
4759
python-version: ${{ matrix.python-version }}
48-
poetry-version: 2.1.2
49-
50-
- name: Run Unit tests
51-
run: poetry run nox -s test:unit
5260

5361
- name: Run lint
54-
run: poetry run nox -s lint:code
62+
run: poetry run -- nox -s lint:code
5563

5664
- name: Upload Artifacts
57-
uses: actions/upload-artifact@v4.4.0
65+
uses: actions/upload-artifact@v4.6.0
5866
with:
5967
name: lint-python${{ matrix.python-version }}
60-
path: .lint.txt
68+
path: |
69+
.lint.txt
70+
.lint.json
6171
include-hidden-files: true
6272

6373
Type-Check:
@@ -73,13 +83,12 @@ jobs:
7383
uses: actions/checkout@v4
7484

7585
- name: Setup Python & Poetry Environment
76-
uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0
86+
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
7787
with:
7888
python-version: ${{ matrix.python-version }}
79-
poetry-version: 2.1.2
8089

8190
- name: Run type-check
82-
run: poetry run nox -s lint:typing
91+
run: poetry run -- nox -s lint:typing
8392

8493
Security:
8594
name: Security Checks (Python-${{ matrix.python-version }})
@@ -94,17 +103,78 @@ jobs:
94103
uses: actions/checkout@v4
95104

96105
- name: Setup Python & Poetry Environment
97-
uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0
106+
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
98107
with:
99108
python-version: ${{ matrix.python-version }}
100-
poetry-version: 2.1.2
101109

102110
- name: Run security linter
103-
run: poetry run nox -s lint:security
111+
run: poetry run -- nox -s lint:security
104112

105113
- name: Upload Artifacts
106-
uses: actions/upload-artifact@v4.4.0
114+
uses: actions/upload-artifact@v4.6.0
107115
with:
108116
name: security-python${{ matrix.python-version }}
109117
path: .security.json
110118
include-hidden-files: true
119+
120+
Format:
121+
name: Format Check
122+
runs-on: ubuntu-24.04
123+
124+
steps:
125+
- name: SCM Checkout
126+
uses: actions/checkout@v4
127+
128+
- name: Setup Python & Poetry Environment
129+
uses: exasol/python-toolbox/.github/actions/[email protected]
130+
131+
- name: Run format check
132+
run: poetry run -- nox -s project:format
133+
134+
Tests:
135+
name: Unit-Tests (Python-${{ matrix.python-version }})
136+
needs: [ Lint, Type-Check, Security, Format, build-matrix ]
137+
runs-on: ubuntu-24.04
138+
env:
139+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140+
strategy:
141+
fail-fast: false
142+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
143+
144+
steps:
145+
- name: SCM Checkout
146+
uses: actions/checkout@v4
147+
148+
- name: Setup Python & Poetry Environment
149+
uses: exasol/python-toolbox/.github/actions/[email protected]
150+
with:
151+
python-version: ${{ matrix.python-version }}
152+
153+
- name: Run Tests and Collect Coverage
154+
run: poetry run -- nox -s test:unit -- --coverage
155+
156+
- name: Upload Artifacts
157+
uses: actions/[email protected]
158+
with:
159+
name: coverage-python${{ matrix.python-version }}-fast
160+
path: .coverage
161+
include-hidden-files: true
162+
163+
test-exaslct-alias-script:
164+
needs: build-matrix
165+
strategy:
166+
fail-fast: false
167+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
168+
169+
runs-on: ubuntu-24.04
170+
steps:
171+
172+
- uses: actions/checkout@v4
173+
174+
- name: Setup Python & Poetry Environment
175+
uses: exasol/python-toolbox/.github/actions/[email protected]
176+
with:
177+
python-version: '${{ matrix.python_version }}'
178+
179+
- name: Test exaslct
180+
run: poetry run exaslct --help

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- "github-pages/*"
7+
- "gh-pages/*"
8+
- "main"
9+
- "master"
10+
schedule:
11+
# “At 00:00 on every 7th day-of-month from 1 through 31.” (https://crontab.guru)
12+
- cron: "0 0 1/7 * *"
13+
14+
jobs:
15+
16+
CI:
17+
uses: ./.github/workflows/merge-gate.yml
18+
secrets: inherit

.github/workflows/main.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

.github/workflows/matrix-python.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@ jobs:
1717
uses: actions/checkout@v4
1818

1919
- name: Setup Python & Poetry Environment
20-
uses: exasol/python-toolbox/.github/actions/[email protected]
21-
with:
22-
poetry-version: 2.1.2
20+
uses: exasol/python-toolbox/.github/actions/[email protected]
2321

2422
- name: Generate matrix
25-
run: poetry run nox -s matrix:python
23+
run: poetry run -- nox -s matrix:python
2624

2725
- id: set-matrix
2826
run: |
29-
echo "matrix=$(poetry run nox -s matrix:python)" >> $GITHUB_OUTPUT
27+
echo "matrix=$(poetry run -- nox -s matrix:python)" >> $GITHUB_OUTPUT
3028
3129
outputs:
3230
matrix: ${{ steps.set-matrix.outputs.matrix }}

.github/workflows/merge-gate.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Merge-Gate
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
DOCKER_USERNAME:
7+
required: true
8+
DOCKER_PASSWORD:
9+
required: true
10+
jobs:
11+
12+
fast-checks:
13+
name: Fast
14+
uses: ./.github/workflows/checks.yml
15+
16+
slow-checks:
17+
name: Slow
18+
uses: ./.github/workflows/slow-checks.yml
19+
secrets: inherit
20+
21+
# This job ensures inputs have been executed successfully.
22+
approve-merge:
23+
name: Allow Merge
24+
runs-on: ubuntu-24.04
25+
# If you need additional jobs to be part of the merge gate, add them below
26+
needs: [ fast-checks, slow-checks ]
27+
28+
# Each job requires a step, so we added this dummy step.
29+
steps:
30+
- name: Approve
31+
run: |
32+
echo "Merge Approved"

0 commit comments

Comments
 (0)