👷 Update GitHub Actions to download and upload artifacts (#936)

This commit is contained in:
Sebastián Ramírez 2024-05-10 14:00:24 -07:00 committed by GitHub
parent df0f834227
commit e4013acc54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 20 additions and 19 deletions

View File

@ -71,7 +71,7 @@ jobs:
run: python ./scripts/docs.py verify-readme run: python ./scripts/docs.py verify-readme
- name: Build Docs - name: Build Docs
run: python ./scripts/docs.py build run: python ./scripts/docs.py build
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v4
with: with:
name: docs-site name: docs-site
path: ./site/** path: ./site/**

View File

@ -19,18 +19,16 @@ jobs:
run: | run: |
rm -rf ./site rm -rf ./site
mkdir ./site mkdir ./site
- name: Download Artifact Docs - uses: actions/download-artifact@v4
id: download
uses: dawidd6/action-download-artifact@v2.28.0
with: with:
if_no_artifact_found: ignore
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: build-docs.yml
run_id: ${{ github.event.workflow_run.id }}
name: docs-site
path: ./site/ path: ./site/
pattern: docs-site
merge-multiple: true
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: Deploy to Cloudflare Pages - name: Deploy to Cloudflare Pages
if: steps.download.outputs.found_artifact == 'true' # hashFiles returns an empty string if there are no files
if: hashFiles('./site/*')
id: deploy id: deploy
uses: cloudflare/pages-action@v1 uses: cloudflare/pages-action@v1
with: with:

View File

@ -20,12 +20,14 @@ jobs:
- run: pip install smokeshow - run: pip install smokeshow
- uses: dawidd6/action-download-artifact@v2.28.0 - uses: actions/download-artifact@v4
with: with:
workflow: test.yml name: coverage-html
commit: ${{ github.event.workflow_run.head_sha }} path: htmlcov
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- run: smokeshow upload coverage-html - run: smokeshow upload htmlcov
env: env:
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage} SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 95 SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 95

View File

@ -72,9 +72,9 @@ jobs:
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }} COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }} CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
- name: Store coverage files - name: Store coverage files
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: coverage name: coverage-${{ matrix.python-version }}-${{ matrix.pydantic-version }}
path: coverage path: coverage
coverage-combine: coverage-combine:
needs: needs:
@ -89,10 +89,11 @@ jobs:
python-version: '3.8' python-version: '3.8'
- name: Get coverage files - name: Get coverage files
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: coverage pattern: coverage-*
path: coverage path: coverage
merge-multiple: true
- run: pip install coverage[toml] - run: pip install coverage[toml]
@ -102,7 +103,7 @@ jobs:
- run: coverage html --show-contexts --title "Coverage for ${{ github.sha }}" - run: coverage html --show-contexts --title "Coverage for ${{ github.sha }}"
- name: Store coverage HTML - name: Store coverage HTML
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: coverage-html name: coverage-html
path: htmlcov path: htmlcov