Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues in the workflow simplifications of #1054 #1058

Merged
merged 4 commits into from
Mar 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 45 additions & 5 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 #
############
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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' &&
Expand All @@ -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
Expand All @@ -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
Expand Down