Skip to content

Commit e4013ac

Browse files
authored
👷 Update GitHub Actions to download and upload artifacts (#936)
1 parent df0f834 commit e4013ac

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

.github/workflows/build-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
run: python ./scripts/docs.py verify-readme
7272
- name: Build Docs
7373
run: python ./scripts/docs.py build
74-
- uses: actions/upload-artifact@v3
74+
- uses: actions/upload-artifact@v4
7575
with:
7676
name: docs-site
7777
path: ./site/**

.github/workflows/deploy-docs.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,16 @@ jobs:
1919
run: |
2020
rm -rf ./site
2121
mkdir ./site
22-
- name: Download Artifact Docs
23-
id: download
24-
uses: dawidd6/[email protected]
22+
- uses: actions/download-artifact@v4
2523
with:
26-
if_no_artifact_found: ignore
27-
github_token: ${{ secrets.GITHUB_TOKEN }}
28-
workflow: build-docs.yml
29-
run_id: ${{ github.event.workflow_run.id }}
30-
name: docs-site
3124
path: ./site/
25+
pattern: docs-site
26+
merge-multiple: true
27+
github-token: ${{ secrets.GITHUB_TOKEN }}
28+
run-id: ${{ github.event.workflow_run.id }}
3229
- name: Deploy to Cloudflare Pages
33-
if: steps.download.outputs.found_artifact == 'true'
30+
# hashFiles returns an empty string if there are no files
31+
if: hashFiles('./site/*')
3432
id: deploy
3533
uses: cloudflare/pages-action@v1
3634
with:

.github/workflows/smokeshow.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ jobs:
2020

2121
- run: pip install smokeshow
2222

23-
- uses: dawidd6/action-download-artifact@v2.28.0
23+
- uses: actions/download-artifact@v4
2424
with:
25-
workflow: test.yml
26-
commit: ${{ github.event.workflow_run.head_sha }}
25+
name: coverage-html
26+
path: htmlcov
27+
github-token: ${{ secrets.GITHUB_TOKEN }}
28+
run-id: ${{ github.event.workflow_run.id }}
2729

28-
- run: smokeshow upload coverage-html
30+
- run: smokeshow upload htmlcov
2931
env:
3032
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
3133
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 95

.github/workflows/test.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ jobs:
7272
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
7373
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
7474
- name: Store coverage files
75-
uses: actions/upload-artifact@v3
75+
uses: actions/upload-artifact@v4
7676
with:
77-
name: coverage
77+
name: coverage-${{ matrix.python-version }}-${{ matrix.pydantic-version }}
7878
path: coverage
7979
coverage-combine:
8080
needs:
@@ -89,10 +89,11 @@ jobs:
8989
python-version: '3.8'
9090

9191
- name: Get coverage files
92-
uses: actions/download-artifact@v3
92+
uses: actions/download-artifact@v4
9393
with:
94-
name: coverage
94+
pattern: coverage-*
9595
path: coverage
96+
merge-multiple: true
9697

9798
- run: pip install coverage[toml]
9899

@@ -102,7 +103,7 @@ jobs:
102103
- run: coverage html --show-contexts --title "Coverage for ${{ github.sha }}"
103104

104105
- name: Store coverage HTML
105-
uses: actions/upload-artifact@v3
106+
uses: actions/upload-artifact@v4
106107
with:
107108
name: coverage-html
108109
path: htmlcov

0 commit comments

Comments
 (0)