diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 025f329bdb1..5a19d5d96b2 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -378,6 +378,26 @@ jobs: name: openverse-api-openapi-schema.yaml path: ./api/openapi.yaml + # This job runs when `django-checks` doesn't and always passes, thus allowing + # PRs to meet the required checks criteria and be merged. + bypass-django-checks: + name: Run Django checks + if: needs.get-changes.outputs.api != 'true' + runs-on: ubuntu-latest + needs: + - get-changes + strategy: + matrix: + recipe: + - "api/dj check" + - "api/dj validateopenapischema" + - "api/dj makemigrations --check --noinput --merge" + - "api/doc-test" + + steps: + - name: Pass + run: echo 'Django checks are skipped because API is unchanged.' + ############ # Frontend # ############ @@ -492,6 +512,25 @@ jobs: name: ${{ matrix.name }}_test_results path: frontend/test-results + # This job runs when `playwright` doesn't and always passes, thus allowing + # PRs to meet the required checks criteria and be merged. + bypass-playwright: + name: Run Playwright tests + if: needs.get-changes.outputs.frontend != 'true' + runs-on: ubuntu-latest + needs: + - get-changes + strategy: + matrix: + name: + - playwright_vr + - playwright_e2e + - storybook_vr + + steps: + - name: Pass + run: echo 'Playwright tests are skipped because frontend is unchanged.' + playwright-test-failure-comment: name: Post Playwright test debugging instructions if: | @@ -546,7 +585,10 @@ jobs: if: | !failure() && !cancelled() && ( - github.event_name == 'push' || + ( + github.event_name == 'push' && + github.repository == 'WordPress/openverse' + ) || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login == 'WordPress' && @@ -561,8 +603,6 @@ jobs: - test-ing - test-api - nuxt-build - env: - REPO_NAME: ${{ github.event.pull_request.head.repo.name }} steps: - name: Checkout repository @@ -583,8 +623,8 @@ jobs: - name: Recreate working directory # to avoid superfluous files from getting tracked automatically run: | cd .. - sudo rm -rf "$REPO_NAME" - mkdir "$REPO_NAME" + sudo rm -rf openverse + mkdir openverse - name: Checkout repository at `gh-pages` branch uses: actions/checkout@v3