Skip to content

Commit ddbf5d6

Browse files
committed
feat: trying out the release process
1 parent e39c4c7 commit ddbf5d6

11 files changed

Lines changed: 216 additions & 59 deletions

File tree

.github/workflows/commitlint.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name: Commits
22

3-
on: pull_request
4-
5-
permissions:
6-
contents: read
7-
pull-requests: read
3+
on:
4+
workflow_call:
5+
inputs:
6+
ref:
7+
required: true
8+
type: string
89

910
jobs:
1011
lint-commits:
@@ -14,6 +15,9 @@ jobs:
1415
steps:
1516
- name: Checkout code
1617
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ inputs.ref }}
20+
fetch-depth: 0
1721

1822
- name: Inspect Commits
1923
uses: wagoid/commitlint-github-action@v6

.github/workflows/integration.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
name: Compatibility
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
4+
workflow_call:
5+
inputs:
6+
library_ref:
7+
required: true
8+
type: string
9+
sanity_ref:
10+
required: true
11+
type: string
812

913
jobs:
1014
check-compatibility:
@@ -19,12 +23,13 @@ jobs:
1923
- name: Checkout code
2024
uses: actions/checkout@v4
2125
with:
26+
ref: ${{ inputs.library_ref }}
2227
path: project/library
2328

2429
- name: Checkout sanity stub
2530
uses: actions/checkout@v4
2631
with:
27-
ref: sanity
32+
ref: ${{ inputs.sanity_ref }}
2833
path: project/sanity
2934

3035
- name: Install poetry

.github/workflows/linting.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
name: Linting
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
9-
permissions:
10-
contents: write
4+
workflow_call:
5+
inputs:
6+
ref:
7+
required: true
8+
type: string
9+
commit_changes:
10+
required: false
11+
type: boolean
12+
default: false
1113

1214
defaults:
1315
run:
@@ -22,7 +24,7 @@ jobs:
2224
- name: Checkout code
2325
uses: actions/checkout@v4
2426
with:
25-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
27+
ref: ${{ inputs.ref }}
2628
fetch-depth: 0
2729

2830
- name: Install poetry
@@ -42,6 +44,7 @@ jobs:
4244
run: poetry run ruff format .
4345

4446
- name: Commit Changes
47+
if: ${{ inputs.commit_changes == true }}
4548
uses: stefanzweifel/git-auto-commit-action@v5
4649
with:
4750
commit_message: 'style: Apply automated code formatting [skip ci]'

.github/workflows/pipeline.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: write
11+
actions: read
12+
checks: write
13+
pull-requests: write
14+
packages: write
15+
16+
jobs:
17+
lint-commits:
18+
name: Run Commitlint Checks
19+
if: github.event_name == 'pull_request'
20+
uses: ./.github/workflows/commitlint.yml
21+
with:
22+
ref: ${{ github.event.pull_request.head.sha }}
23+
secrets: inherit
24+
25+
code-style:
26+
name: Run Linter Formatter
27+
uses: ./.github/workflows/linting.yml
28+
with:
29+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
30+
commit_changes: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
31+
secrets: inherit
32+
33+
compat-check:
34+
name: Run Compatibility Checks
35+
uses: ./.github/workflows/integration.yml
36+
with:
37+
library_ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
38+
sanity_ref: sanity
39+
secrets: inherit
40+
41+
type-check:
42+
name: Run Type Checks
43+
uses: ./.github/workflows/typecheck.yml
44+
with:
45+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
46+
secrets: inherit
47+
48+
run-tests:
49+
name: Run Test Suite
50+
uses: ./.github/workflows/test.yml
51+
with:
52+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
53+
secrets:
54+
BASE_URL: ${{ secrets.BASE_URL }}
55+
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
56+
JWT_KEY: ${{ secrets.JWT_KEY }}
57+
CLIENT_ID: ${{ secrets.CLIENT_ID }}
58+
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
61+
code-inspection:
62+
name: Run Qodana Inspections
63+
needs: run-tests
64+
uses: ./.github/workflows/qodana.yml
65+
with:
66+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
67+
secrets:
68+
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
69+
70+
all-passed:
71+
name: Check Build Status
72+
runs-on: ubuntu-latest
73+
needs:
74+
#- lint-commits
75+
- code-style
76+
- compat-check
77+
- type-check
78+
- run-tests
79+
- code-inspection
80+
if: ${{ always() && (needs.lint-commits.result == 'success' || needs.lint-commits.result == 'skipped') && needs.code-style.result == 'success' && needs.compat-check.result == 'success' && needs.type-check.result == 'success' && needs.run-tests.result == 'success' && needs.code-inspection.result == 'success' }}
81+
steps:
82+
- name: Report Success
83+
run: echo "All required checks passed successfully."
84+
85+
release-package:
86+
name: Do Release Artifact
87+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
88+
needs:
89+
- all-passed
90+
uses: ./.github/workflows/release.yml
91+
secrets:
92+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

.github/workflows/qodana.yml

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

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
9-
permissions:
10-
contents: read
11-
checks: write
12-
pull-requests: write
4+
workflow_call:
5+
inputs:
6+
ref:
7+
required: true
8+
type: string
9+
test_artifact_name:
10+
required: false
11+
type: string
12+
default: test-results
13+
coverage_artifact_name:
14+
required: false
15+
type: string
16+
default: test-coverage
17+
secrets:
18+
QODANA_TOKEN:
19+
required: true
1320

1421
defaults:
1522
run:
@@ -24,8 +31,15 @@ jobs:
2431
- name: Checkout code
2532
uses: actions/checkout@v4
2633
with:
34+
ref: ${{ inputs.ref }}
2735
fetch-depth: 0
2836

37+
- name: Download Test Reports Artifact
38+
uses: actions/download-artifact@v4
39+
with:
40+
name: ${{ inputs.test_artifact_name }}
41+
path: ./qodana-downloaded-reports/test-results
42+
2943
- name: Run Qodana
3044
uses: JetBrains/qodana-action@v2025.1
3145
with:

.github/workflows/release.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
name: Release
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
8-
permissions:
9-
contents: write
4+
workflow_call:
5+
secrets:
6+
PYPI_TOKEN:
7+
required: true
108

119
defaults:
1210
run:
@@ -20,6 +18,8 @@ jobs:
2018
steps:
2119
- name: Checkout code
2220
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
2323

2424
- name: Install poetry
2525
run: |
@@ -31,6 +31,11 @@ jobs:
3131
python-version-file: 'pyproject.toml'
3232
cache: 'poetry'
3333

34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: 'lts/*'
38+
3439
- name: Install Semantic Release
3540
run: |
3641
npm install --global semantic-release $(jq -r '.plugins[] | if type == "string" then . else .[0] end' .releaserc.json)

.github/workflows/test.yml

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
name: Testing
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
9-
permissions:
10-
contents: write
4+
workflow_call:
5+
inputs:
6+
ref:
7+
required: true
8+
type: string
9+
secrets:
10+
BASE_URL:
11+
required: false
12+
AUTH_TOKEN:
13+
required: false
14+
JWT_KEY:
15+
required: false
16+
CLIENT_ID:
17+
required: false
18+
CLIENT_SECRET:
19+
required: false
1120

1221
defaults:
1322
run:
@@ -21,6 +30,8 @@ jobs:
2130
steps:
2231
- name: Checkout code
2332
uses: actions/checkout@v4
33+
with:
34+
ref: ${{ inputs.ref }}
2435

2536
- name: Install poetry
2637
run: |
@@ -36,7 +47,7 @@ jobs:
3647
run: poetry install --no-interaction --sync --all-extras
3748

3849
- name: Run Tests
39-
run: poetry run pytest
50+
run: poetry run pytest --junitxml=build/reports/junit.xml
4051
env:
4152
BASE_URL: ${{ secrets.BASE_URL }}
4253
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
@@ -49,13 +60,21 @@ jobs:
4960
if: always()
5061
with:
5162
name: test-results
52-
path: build/reports/**/*.xml
63+
path: build/reports/junit.xml
64+
65+
- name: Upload Coverage
66+
uses: actions/upload-artifact@v4
67+
if: always()
68+
with:
69+
name: test-coverage
70+
path: build/coverage/clover.xml
5371

5472
- name: Generate Report
55-
if: ${{ always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) }}
73+
if: ${{ always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
5674
uses: dorny/test-reporter@v2.0.0
5775
with:
5876
name: Tests
77+
path: build/reports/junit.xml
5978
reporter: java-junit
60-
path: build/reports/**/*.xml
79+
fail-on-error: 'true'
6180
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/typecheck.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
name: Typecheck
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
9-
permissions:
10-
contents: read
4+
workflow_call:
5+
inputs:
6+
ref:
7+
required: true
8+
type: string
119

1210
defaults:
1311
run:
1412
working-directory: ./
1513

1614
jobs:
17-
steep-check:
15+
mypy-check:
1816
runs-on: ubuntu-latest
1917
name: Inspect Code
2018

2119
steps:
2220
- name: Checkout code
2321
uses: actions/checkout@v4
22+
with:
23+
ref: ${{ inputs.ref }}
2424

2525
- name: Install poetry
2626
run: |

0 commit comments

Comments
 (0)