Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Simplify and fix bundle size workflow (#894)

Dhruv Bhanushali48ba7c5ce50a
diff --git a/.github/actions/get-changes/action.yml b/.github/actions/get-changes/action.yml
index 99c551d6c..297b955cc 100644
--- a/.github/actions/get-changes/action.yml
+++ b/.github/actions/get-changes/action.yml
@@ -11,6 +11,9 @@ outputs:
frontend:
description: "'true' if frontend changes are present"
value: ${{ steps.paths-filter.outputs.frontend }}
+ lint:
+ description: "'true' if linting setup changes are present"
+ value: ${{ steps.paths-filter.outputs.frontend }}
runs:
using: "composite"
diff --git a/.github/filters.yml b/.github/filters.yml
index e60f01e39..2773b0e5c 100644
--- a/.github/filters.yml
+++ b/.github/filters.yml
@@ -18,3 +18,9 @@ frontend:
- .pnpmfile.cjs
# Change to the CI + CD workflow should trigger complete workflow.
- .github/workflows/ci_cd.yml
+lint:
+ - prettier.config.js
+ - .prettierignore
+ - .eslintrc.js
+ - .eslintignore
+ - .pre-commit-config.yaml
diff --git a/.github/workflows/bundle_size.yml b/.github/workflows/bundle_size.yml
index cd2e6e81c..16e385e61 100644
--- a/.github/workflows/bundle_size.yml
+++ b/.github/workflows/bundle_size.yml
@@ -1,26 +1,7 @@
-name: Compressed Size
+name: Nuxt bundle size
on:
pull_request:
- paths:
- - "**.ts"
- - "**.js"
- - "**.vue"
- - "**.css"
- # Changes to any dependency
- - "pnpm-lock.yaml"
- # This file configures ESLint. Changes could affect the outcome.
- - "**.eslint*"
- # This file configures Prettier. Changes could affect the outcome.
- - "**.prettier*"
- # This file configures TypeScript. Changes could affect the outcome.
- - "**.tsconfig*"
- # This file configures Nuxt (and therefore the build). Changes could affect the outcome.
- - "frontend/nuxt.config.ts"
- # This file configures Tailwind and could affect the style outcome.
- - "frontend/tailwind.config.js"
- # Changes to this workflow file should always verify the changes are successful.
- - ".github/workflows/bundle_size.yml"
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
@@ -30,10 +11,31 @@ concurrency:
cancel-in-progress: true
jobs:
+ get-changes:
+ name: Get changes
+ runs-on: ubuntu-latest
+ permissions:
+ pull-requests: read
+ outputs:
+ frontend: ${{ steps.paths-filter.outputs.frontend }}
+ lint: ${{ steps.paths-filter.outputs.lint }}
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+
+ - name: Get changes
+ id: paths-filter
+ uses: ./.github/actions/get-changes
+
build:
name: Check
runs-on: ubuntu-latest
- if: github.repository == 'WordPress/openverse-frontend'
+ if: |
+ github.repository == 'WordPress/openverse' &&
+ (needs.get-changes.outputs.frontend == 'true' || needs.get-changes.outputs.lint == 'true')
+ needs:
+ - get-changes
steps:
- name: Checkout repository
@@ -44,6 +46,7 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
setup_python: false
+ install_recipe: node-install
- uses: preactjs/[email protected]
with: