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
This commit is contained in:
Masen Furer 2024-02-23 11:23:28 -08:00 committed by GitHub
parent d698e4dcd7
commit 82e3be76cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 }}