From: Sebastián Ramírez Date: Fri, 10 May 2024 21:00:24 +0000 (-0700) Subject: 👷 Update GitHub Actions to download and upload artifacts (#936) X-Git-Tag: 0.0.19~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4013acc548f809001179fd48192052e927547a4;p=thirdparty%2Ffastapi%2Fsqlmodel.git 👷 Update GitHub Actions to download and upload artifacts (#936) --- diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index b9e1d336..16da4a2d 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -71,7 +71,7 @@ jobs: run: python ./scripts/docs.py verify-readme - name: Build Docs run: python ./scripts/docs.py build - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: docs-site path: ./site/** diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index f9035d89..41320b57 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -19,18 +19,16 @@ jobs: run: | rm -rf ./site mkdir ./site - - name: Download Artifact Docs - id: download - uses: dawidd6/action-download-artifact@v2.28.0 + - uses: actions/download-artifact@v4 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/ + pattern: docs-site + merge-multiple: true + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} - 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 uses: cloudflare/pages-action@v1 with: diff --git a/.github/workflows/smokeshow.yml b/.github/workflows/smokeshow.yml index 44ce46cf..bc37a92e 100644 --- a/.github/workflows/smokeshow.yml +++ b/.github/workflows/smokeshow.yml @@ -20,12 +20,14 @@ jobs: - run: pip install smokeshow - - uses: dawidd6/action-download-artifact@v2.28.0 + - uses: actions/download-artifact@v4 with: - workflow: test.yml - commit: ${{ github.event.workflow_run.head_sha }} + name: coverage-html + path: htmlcov + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} - - run: smokeshow upload coverage-html + - run: smokeshow upload htmlcov env: SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage} SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 95 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 59260fa7..70e64094 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,9 +72,9 @@ jobs: COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }} CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }} - name: Store coverage files - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: coverage + name: coverage-${{ matrix.python-version }}-${{ matrix.pydantic-version }} path: coverage coverage-combine: needs: @@ -89,10 +89,11 @@ jobs: python-version: '3.8' - name: Get coverage files - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: coverage + pattern: coverage-* path: coverage + merge-multiple: true - run: pip install coverage[toml] @@ -102,7 +103,7 @@ jobs: - run: coverage html --show-contexts --title "Coverage for ${{ github.sha }}" - name: Store coverage HTML - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-html path: htmlcov