]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
👷 Update GitHub actions to download and upload artifacts to v4, for docs and coverage...
authorTamir Duberstein <tamird@gmail.com>
Fri, 10 May 2024 00:30:25 +0000 (20:30 -0400)
committerGitHub <noreply@github.com>
Fri, 10 May 2024 00:30:25 +0000 (17:30 -0700)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
.github/workflows/build-docs.yml
.github/workflows/deploy-docs.yml
.github/workflows/test.yml

index 4ff5e26cbf94193fc028219edcc3a95b8c1d068f..262c7fa5cbf595a53c3f3d55a408ec8219d71e7a 100644 (file)
@@ -108,9 +108,9 @@ jobs:
           path: docs/${{ matrix.lang }}/.cache
       - name: Build Docs
         run: python ./scripts/docs.py build-lang ${{ matrix.lang }}
-      - uses: actions/upload-artifact@v3
+      - uses: actions/upload-artifact@v4
         with:
-          name: docs-site
+          name: docs-site-${{ matrix.lang }}
           path: ./site/**
 
   # https://github.com/marketplace/actions/alls-green#why
index b8dbb7dc5a74b926677b9d2e644bb2d50fc47496..dd54608d93d185ea6932b1bdd1609a53568d16b8 100644 (file)
@@ -19,18 +19,16 @@ jobs:
         run: |
           rm -rf ./site
           mkdir ./site
-      - name: Download Artifact Docs
-        id: download
-        uses: dawidd6/action-download-artifact@v3.1.4
+      - uses: actions/download-artifact@v4
         with:
-          if_no_artifact_found: ignore
-          github_token: ${{ secrets.FASTAPI_PREVIEW_DOCS_DOWNLOAD_ARTIFACTS }}
-          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.FASTAPI_PREVIEW_DOCS_DOWNLOAD_ARTIFACTS }}
+          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:
index fe1e419d68945a2279b5347e1b363fa068a5e423..a33b6a68a25de5b3efa386045b01e51679288395 100644 (file)
@@ -87,9 +87,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:
@@ -108,17 +108,18 @@ jobs:
           # cache: "pip"
           # cache-dependency-path: pyproject.toml
       - 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]
       - run: ls -la coverage
       - run: coverage combine coverage
       - run: coverage report
       - 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