Skip to content

Commit

Permalink
chained actions
Browse files Browse the repository at this point in the history
Signed-off-by: Melvin Strobl <[email protected]>
  • Loading branch information
Melvin Strobl committed Sep 25, 2024
1 parent 3e9996a commit a345561
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Documentation
on:
push:
branches:
- main
workflow_run:
workflows: ['Testing']
types: [completed]
branches: ["main"]
permissions:
contents: write
jobs:
Expand All @@ -20,16 +21,21 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'poetry' # caching pip dependencies
cache: 'poetry'
- name: Install dependencies
run: poetry install --with docs
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV # (3)!
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- name: Setting up Cache
uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .ci-cache
restore-keys: |
mkdocs-material-
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: coverage-report
path: docs/coverage.html
- name: Deploy
run: poetry run mkdocs gh-deploy --force
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'poetry' # caching pip dependencies
cache: 'poetry'
- name: Install dependencies
run: poetry install --with dev
- name: Test with pytest
run: |
poetry run coverage run -m pytest
poetry run coverage report -m
- name: Share coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: htmlcov/index.html

0 comments on commit a345561

Please sign in to comment.