Bläddra i källkod

benchmarks.yml: skip benchmarking if the DATABASE_URL is not set (#2701)

* benchmarks.yml: skip benchmarking if the DATABASE_URL is not set

* try to expand the value

* workaround secrets not available in the `if:` condition

* only skip database / pytest step if missing creds
Masen Furer 1 år sedan
förälder
incheckning
82e3be76cf
1 ändrade filer med 4 tillägg och 1 borttagningar
  1. 4 1
      .github/workflows/benchmarks.yml

+ 4 - 1
.github/workflows/benchmarks.yml

@@ -24,6 +24,8 @@ env:
 
 
 jobs:
 jobs:
   reflex-web:
   reflex-web:
+    env:
+      DATABASE_URL: ${{ secrets.DATABASE_URL }}
     strategy:
     strategy:
       fail-fast: false
       fail-fast: false
       matrix:
       matrix:
@@ -66,9 +68,10 @@ jobs:
         env:
         env:
           LHCI_GITHUB_APP_TOKEN: $
           LHCI_GITHUB_APP_TOKEN: $
       - name: Run Benchmarks
       - name: Run Benchmarks
+        # Only run if the database creds are available in this context.
+        if: ${{ env.DATABASE_URL }}
         working-directory: ./integration/benchmarks
         working-directory: ./integration/benchmarks
         run: poetry run python benchmarks.py "$GITHUB_SHA" .lighthouseci
         run: poetry run python benchmarks.py "$GITHUB_SHA" .lighthouseci
         env:
         env:
           GITHUB_SHA: ${{ github.sha }}
           GITHUB_SHA: ${{ github.sha }}
-          DATABASE_URL: ${{ secrets.DATABASE_URL }}
           PR_TITLE: ${{ github.event.pull_request.title }}
           PR_TITLE: ${{ github.event.pull_request.title }}