Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
No docs, Docker images or deploys if CI + CD workflow changes (#1933)
Dhruv Bhanushali209cd44abed6
diff --git a/.github/filters.yml b/.github/filters.ymlindex 2bc13e6aa..5ca06a04e 100644--- a/.github/filters.yml+++ b/.github/filters.yml@@ -1,31 +1,50 @@+# This file is used by the `get-changes` action to determine the changesets.+# Also see+# - list of stacks: job `add-stack-label` of workflow `ci_cd.yml`+# - list of stack labels: https://github.com/WordPress/openverse/labels?q=stackcatalog:- catalog/**- # Change to the CI + CD workflow should trigger complete workflow.- - .github/workflows/ci_cd.yml+ - docker/minio/**+ - docker/upstream_db/**api:- api/**- # Change to the CI + CD workflow should trigger complete workflow.- - .github/workflows/ci_cd.yml+ - docker/db/**+ - docker/es/**+ - docker/nginx/**+ - load_sample_data.shingestion_server:- ingestion_server/**- # Change to the CI + CD workflow should trigger complete workflow.- - .github/workflows/ci_cd.yml+ - docker/db/**+ - docker/es/**+ - docker/upstream_db/**+ - load_sample_data.shfrontend:- frontend/**- package.json- pnpm-lock.yaml- pnpm-workspace.yaml+ - tsconfig.json- .npmrc- .pnpmfile.cjs- # Change to the CI + CD workflow should trigger complete workflow.- - .github/workflows/ci_cd.yml+analytics:+ - docker/clickhouse/**+ - docker/plausible/**+ - docker/plausible_db/**+ - setup_plausible.shdocumentation:- documentation/**- # Change to the CI + CD workflow should trigger complete workflow.- - .github/workflows/ci_cd.ymllint:- prettier.config.js- - .prettierignore+ - .editorconfig- .eslintrc.js- .eslintignore+ - .isort.cfg+ - .ruff.toml+ - .prettierignore- .pre-commit-config.yaml+mgmt:+ - .github/**+ - automations/**+ci_cd:+ - .github/actions/**+ - .github/workflows/ci_cd.ymldiff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.ymlindex 77302205c..324ffba02 100644--- a/.github/workflows/ci_cd.yml+++ b/.github/workflows/ci_cd.yml@@ -36,6 +36,7 @@ jobs:api: ${{ contains(fromJson(steps.paths-filter.outputs.changes), 'api') }}frontend: ${{ contains(fromJson(steps.paths-filter.outputs.changes), 'frontend') }}documentation: ${{ contains(fromJson(steps.paths-filter.outputs.changes), 'documentation') }}+ ci_cd: ${{ contains(fromJson(steps.paths-filter.outputs.changes), 'ci_cd') }}steps:- name: Checkout repositoryuses: actions/checkout@v3@@ -124,26 +125,27 @@ jobs:- get-changessteps:- - name: Checkout repository- uses: actions/checkout@v3-- - name: Add API stack label- uses: actions-ecosystem/action-add-labels@v1- if: ${{ needs.get-changes.outputs.api == 'true' }}- with:- labels: "π§± stack: api"-- - name: Add ingestion server stack label- uses: actions-ecosystem/action-add-labels@v1- if: ${{ needs.get-changes.outputs.ingestion_server == 'true' }}- with:- labels: "π§± stack: ingestion server"-- - name: Add frontend stack label- uses: actions-ecosystem/action-add-labels@v1- if: ${{ needs.get-changes.outputs.frontend == 'true' }}+ - name: Apply stack labels+ uses: actions/github-script@v6with:- labels: "π§± stack: frontend"+ # Also see+ # - list of stack filters: `.github/filters.yml`+ # - list of stack labels: https://github.com/WordPress/openverse/labels?q=stack+ script: |+ const stacks = ["catalog", "api", "ingestion_server", "frontend", "documentation", "mgmt"]+ const labels = JSON+ .parse('${{ needs.get-changes.outputs.changes }}')+ .filter(change => stacks.includes(change))+ .map(change => `π§± stack: ${change.replace("_", " ")}`)+ if (labels.len == 0) {+ labels.push("π¦ status: awaiting triage", "π· status: label work required")+ }+ github.rest.issues.addLabels({+ issue_number: context.issue.number,+ owner: context.repo.owner,+ repo: context.repo.repo,+ labels,+ })build-images:name: Build Docker images@@ -229,7 +231,9 @@ jobs:test-cat:name: Run tests for the catalog- if: needs.get-changes.outputs.catalog == 'true'+ if: |+ needs.get-changes.outputs.catalog == 'true' ||+ needs.get-changes.outputs.ci_cd == 'true'runs-on: ubuntu-latesttimeout-minutes: 15needs:@@ -260,7 +264,9 @@ jobs:catalog-checks:name: Run catalog checks- if: needs.get-changes.outputs.catalog == 'true'+ if: |+ needs.get-changes.outputs.catalog == 'true' ||+ needs.get-changes.outputs.ci_cd == 'true'runs-on: ubuntu-latestneeds:- get-changes@@ -293,7 +299,9 @@ jobs:test-ing:name: Run tests for ingestion-server- if: needs.get-changes.outputs.ingestion_server == 'true'+ if: |+ needs.get-changes.outputs.ingestion_server == 'true' ||+ needs.get-changes.outputs.ci_cd == 'true'runs-on: ubuntu-latesttimeout-minutes: 15needs:@@ -337,7 +345,10 @@ jobs:test-api:name: Run tests for the API- if: needs.get-changes.outputs.ingestion_server == 'true' || needs.get-changes.outputs.api == 'true'+ if: |+ needs.get-changes.outputs.ingestion_server == 'true' ||+ needs.get-changes.outputs.api == 'true' ||+ needs.get-changes.outputs.ci_cd == 'true'runs-on: ubuntu-latesttimeout-minutes: 15needs:@@ -383,7 +394,9 @@ jobs:django-checks:name: Run Django checks- if: needs.get-changes.outputs.api == 'true'+ if: |+ needs.get-changes.outputs.api == 'true' ||+ needs.get-changes.outputs.ci_cd == 'true'runs-on: ubuntu-latestneeds:- get-changes@@ -440,10 +453,12 @@ jobs:# PRs to meet the required checks criteria and be merged.bypass-django-checks:name: Run Django checks- if: needs.get-changes.outputs.api != 'true'+ if: |+ !cancelled() &&+ needs.django-checks.result == 'skipped'runs-on: ubuntu-latestneeds:- - get-changes+ - django-checksstrategy:matrix:name:@@ -462,7 +477,9 @@ jobs:nuxt-build:name: Check Nuxt build- if: needs.get-changes.outputs.frontend == 'true'+ if: |+ needs.get-changes.outputs.frontend == 'true' ||+ needs.get-changes.outputs.ci_cd == 'true'runs-on: ubuntu-latestneeds:- get-changes@@ -486,7 +503,9 @@ jobs:nuxt-checks:name: Run Nuxt checks- if: needs.get-changes.outputs.frontend == 'true'+ if: |+ needs.get-changes.outputs.frontend == 'true' ||+ needs.get-changes.outputs.ci_cd == 'true'runs-on: ubuntu-latestneeds:- get-changes@@ -520,10 +539,12 @@ jobs:# PRs to meet the required checks criteria and be merged.bypass-nuxt-checks:name: Run Nuxt checks- if: needs.get-changes.outputs.frontend != 'true'+ if: |+ !cancelled() &&+ needs.nuxt-checks.result == 'skipped'runs-on: ubuntu-latestneeds:- - get-changes+ - nuxt-checksstrategy:fail-fast: falsematrix:@@ -537,7 +558,9 @@ jobs:playwright:name: Run Playwright tests- if: needs.get-changes.outputs.frontend == 'true'+ if: |+ needs.get-changes.outputs.frontend == 'true' ||+ needs.get-changes.outputs.ci_cd == 'true'runs-on: ubuntu-latesttimeout-minutes: 15needs:@@ -582,10 +605,12 @@ jobs:# PRs to meet the required checks criteria and be merged.bypass-playwright:name: Run Playwright tests- if: needs.get-changes.outputs.frontend != 'true'+ if: |+ !cancelled() &&+ needs.playwright.result == 'skipped'runs-on: ubuntu-latestneeds:- - get-changes+ - playwrightstrategy:matrix:name:@@ -602,10 +627,9 @@ jobs:if: |!cancelled() &&github.event_name == 'pull_request' &&- needs.get-changes.outputs.frontend == 'true'+ needs.playwright.result != ''runs-on: ubuntu-latestneeds:- - get-changes- playwrightsteps:diff --git a/.github/workflows/pr_label_check.yml b/.github/workflows/pr_label_check.ymlindex 03f4ecd31..cb24f8149 100644--- a/.github/workflows/pr_label_check.yml+++ b/.github/workflows/pr_label_check.yml@@ -14,6 +14,7 @@ on:- unlabeledjobs:+ # List of aspect labels: https://github.com/WordPress/openverse/labels?q=aspectcheck_aspect_label:name: Check aspect labelruns-on: ubuntu-latest@@ -24,6 +25,7 @@ jobs:one_of: "π» aspect: code,π aspect: text,π€ aspect: dx,πΉ aspect: interface,βΏοΈ aspect: a11y"repo_token: ${{ secrets.GITHUB_TOKEN }}+ # List of goal labels: https://github.com/WordPress/openverse/labels?q=goalcheck_goal_label:name: Check goal labelruns-on: ubuntu-latest@@ -34,6 +36,7 @@ jobs:one_of: "π goal: addition,π goal: fix,β¨ goal: improvement,π§° goal: internal improvement"repo_token: ${{ secrets.GITHUB_TOKEN }}+ # List of priority labels: https://github.com/WordPress/openverse/labels?q=prioritycheck_priority_label:name: Check priority labelruns-on: ubuntu-latest@@ -44,6 +47,7 @@ jobs:one_of: "π© priority: low,π¨ priority: medium,π§ priority: high,π₯ priority: critical"repo_token: ${{ secrets.GITHUB_TOKEN }}+ # List of stack labels: https://github.com/WordPress/openverse/labels?q=stackcheck_stack_label:name: Check stack labelruns-on: ubuntu-latest@@ -51,5 +55,5 @@ jobs:- name: Check stack labeluses: docker://agilepathway/pull-request-label-checker:v1.4.26with:- any_of: "π§± stack: backend,π§± stack: documentation,π§± stack: frontend,π§± stack: mgmt,π§± stack: api,π§± stack: catalog,π§± stack: ingestion server"+ any_of: "π§± stack: backend,π§± stack: analytics, π§± stack: documentation,π§± stack: frontend,π§± stack: mgmt,π§± stack: api,π§± stack: catalog,π§± stack: ingestion server,π§± stack: infra"repo_token: ${{ secrets.GITHUB_TOKEN }}diff --git a/automations/python/workflows/set_matrix_images.py b/automations/python/workflows/set_matrix_images.pyindex 4599a6836..f68ff0604 100644--- a/automations/python/workflows/set_matrix_images.py+++ b/automations/python/workflows/set_matrix_images.py@@ -37,6 +37,8 @@ includes = {"frontend": {"image": "frontend", "context": "frontend", "target": "app"},}+if "ci_cd" in changes:+ build_matrix["image"] |= set(includes.keys())if "catalog" in changes:build_matrix["image"] |= {"upstream_db", "catalog"}publish_matrix["image"].add("catalog")