File tree 5 files changed +77
-33
lines changed
5 files changed +77
-33
lines changed Original file line number Diff line number Diff line change 1
1
name : Documentation
2
2
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
+
6
13
permissions :
7
14
contents : write
8
15
jobs :
@@ -20,16 +27,22 @@ jobs:
20
27
uses : actions/setup-python@v5
21
28
with :
22
29
python-version : " 3.11"
23
- cache : ' poetry' # caching pip dependencies
30
+ cache : ' poetry'
24
31
- name : Install dependencies
25
32
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
27
34
- name : Setting up Cache
28
35
uses : actions/cache@v4
29
36
with :
30
37
key : mkdocs-material-${{ env.cache_id }}
31
38
path : .ci-cache
32
39
restore-keys : |
33
40
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/
34
47
- name : Deploy
35
48
run : poetry run mkdocs gh-deploy --force
Original file line number Diff line number Diff line change
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
+
Original file line number Diff line number Diff line change 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
-
4
1
name : Quality
5
-
6
2
on :
7
3
push :
8
4
branches : [ "main" ]
9
5
pull_request :
10
6
branches : [ "main" ]
11
-
7
+ workflow_call :
12
8
permissions :
13
9
contents : read
14
-
15
10
jobs :
16
- build :
17
-
11
+ quality :
18
12
runs-on : ubuntu-latest
19
-
20
13
steps :
21
14
- uses : actions/checkout@v4
22
15
- name : Install poetry
25
18
uses : actions/setup-python@v5
26
19
with :
27
20
python-version : " 3.11"
28
- cache : ' poetry' # caching pip dependencies
21
+ cache : ' poetry'
29
22
- name : Install dependencies
30
23
run : poetry install --with dev
31
24
- name : Lint with flake8
Original file line number Diff line number Diff line change 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
-
4
1
name : Testing
5
-
6
2
on :
7
3
push :
8
4
branches : [ "main" ]
9
5
pull_request :
10
6
branches : [ "main" ]
11
-
7
+ workflow_call :
12
8
permissions :
13
- contents : read
14
-
9
+ contents : write
15
10
jobs :
16
- build :
11
+ test :
17
12
runs-on : ubuntu-latest
18
13
steps :
19
14
- uses : actions/checkout@v4
23
18
uses : actions/setup-python@v5
24
19
with :
25
20
python-version : " 3.11"
26
- cache : ' poetry' # caching pip dependencies
21
+ cache : ' poetry'
27
22
- name : Install dependencies
28
23
run : poetry install --with dev
29
24
- 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/
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments