Skip to content

Commit b54772f

Browse files
committed
synced actions
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
1 parent 67ddfc5 commit b54772f

File tree

5 files changed

+77
-33
lines changed

5 files changed

+77
-33
lines changed

.github/workflows/docs.yml

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
name: Documentation
22
on:
3-
push:
4-
branches:
5-
- main
3+
# workflow_run:
4+
# workflows: ['Testing']
5+
# types: [completed]
6+
# branches: ["cx", "main"]
7+
workflow_call:
8+
inputs:
9+
test-run-id:
10+
required: true
11+
type: string
12+
613
permissions:
714
contents: write
815
jobs:
@@ -20,16 +27,22 @@ jobs:
2027
uses: actions/setup-python@v5
2128
with:
2229
python-version: "3.11"
23-
cache: 'poetry' # caching pip dependencies
30+
cache: 'poetry'
2431
- name: Install dependencies
2532
run: poetry install --with docs
26-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV # (3)!
33+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
2734
- name: Setting up Cache
2835
uses: actions/cache@v4
2936
with:
3037
key: mkdocs-material-${{ env.cache_id }}
3138
path: .ci-cache
3239
restore-keys: |
3340
mkdocs-material-
41+
- name: Download a single artifact
42+
uses: actions/download-artifact@v4
43+
with:
44+
name: coverage-report
45+
run-id: ${{ inputs.test-run-id }}
46+
path: docs/coverage/
3447
- name: Deploy
3548
run: poetry run mkdocs gh-deploy --force

.github/workflows/publish.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish
2+
on:
3+
release:
4+
types: [published]
5+
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
jobs:
9+
test:
10+
name: Trigger Tests
11+
uses: ./.github/workflows/test.yml
12+
quality:
13+
name: Trigger Quality
14+
uses: ./.github/workflows/quality.yml
15+
documentation:
16+
needs: test
17+
name: Trigger Documentation
18+
uses: ./.github/workflows/docs.yml
19+
with:
20+
test-run-id: ${{ github.run_id }}
21+
deploy:
22+
needs: [quality, test]
23+
name: Deployment
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Install poetry
28+
run: pipx install poetry
29+
- name: Set up Python 3.11
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: "3.11"
33+
cache: 'poetry'
34+
- name: Install dependencies
35+
run: poetry install --with dev
36+
- name: Publish with Poetry
37+
run: |
38+
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
39+
poetry build
40+
poetry publish
41+
42+
43+

.github/workflows/quality.yml

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
1-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3-
41
name: Quality
5-
62
on:
73
push:
84
branches: [ "main" ]
95
pull_request:
106
branches: [ "main" ]
11-
7+
workflow_call:
128
permissions:
139
contents: read
14-
1510
jobs:
16-
build:
17-
11+
quality:
1812
runs-on: ubuntu-latest
19-
2013
steps:
2114
- uses: actions/checkout@v4
2215
- name: Install poetry
@@ -25,7 +18,7 @@ jobs:
2518
uses: actions/setup-python@v5
2619
with:
2720
python-version: "3.11"
28-
cache: 'poetry' # caching pip dependencies
21+
cache: 'poetry'
2922
- name: Install dependencies
3023
run: poetry install --with dev
3124
- name: Lint with flake8

.github/workflows/test.yml

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3-
41
name: Testing
5-
62
on:
73
push:
84
branches: [ "main" ]
95
pull_request:
106
branches: [ "main" ]
11-
7+
workflow_call:
128
permissions:
13-
contents: read
14-
9+
contents: write
1510
jobs:
16-
build:
11+
test:
1712
runs-on: ubuntu-latest
1813
steps:
1914
- uses: actions/checkout@v4
@@ -23,9 +18,16 @@ jobs:
2318
uses: actions/setup-python@v5
2419
with:
2520
python-version: "3.11"
26-
cache: 'poetry' # caching pip dependencies
21+
cache: 'poetry'
2722
- name: Install dependencies
2823
run: poetry install --with dev
2924
- name: Test with pytest
30-
run: poetry run coverage run -m pytest
31-
# poetry run coverage report -m
25+
run: |
26+
poetry run coverage run -m pytest
27+
poetry run coverage report -m
28+
poetry run coverage html
29+
- name: Share coverage report
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: coverage-report
33+
path: htmlcov/

config.py

-7
This file was deleted.

0 commit comments

Comments
 (0)