Skip to content

Remove the AI Brand Insights modals from the Yoast SEO installation #16878

Remove the AI Brand Insights modals from the Yoast SEO installation

Remove the AI Brand Insights modals from the Yoast SEO installation #16878

Workflow file for this run

name: TestJS
on:
# Run on relevant pushes to select branches and on all relevant pull requests.
push:
branches:
- main
- trunk
- 'release/**'
- 'hotfix/[0-9]+.[0-9]+*'
- 'feature/**'
paths:
- '**.js' # Includes Gruntfile.js.
- '.browserslistrc'
- '.eslintignore'
- '.eslintrc'
- '.nvmrc'
- '.yarnrc'
- 'lerna.json'
- 'package.json'
- 'yarn.lock'
- '.github/workflows/jstest.yml'
- '.yarn/**'
- 'apps/**'
- 'config/grunt/**'
- 'packages/**'
pull_request:
paths:
- '**.js' # Includes Gruntfile.js.
- '.browserslistrc'
- '.eslintignore'
- '.eslintrc'
- '.nvmrc'
- '.yarnrc'
- 'lerna.json'
- 'package.json'
- 'yarn.lock'
- '.github/workflows/jstest.yml'
- '.yarn/**'
- 'apps/**'
- 'config/grunt/**'
- 'packages/**'
# Allow manually triggering the workflow.
workflow_dispatch:
# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
#########################################################################################
# For packages in this job, the full test suite is always run.
#########################################################################################
yarn-test-full:
runs-on: ubuntu-latest
strategy:
# As these packages are all unique, don't stop the workflow when the test run of one package fails.
fail-fast: false
matrix:
package:
- 'analysis-report'
- 'browserslist-config'
- 'components'
- 'dashboard-frontend'
- 'feature-flag'
- 'helpers'
- 'js'
- 'replacement-variable-editor'
- 'search-metadata-previews'
- 'social-metadata-forms'
- 'social-metadata-previews'
- 'ui-library'
name: "TestJS - ${{ matrix.package }} (full)"
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# The ubuntu images come with Node, npm and yarn pre-installed.
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
# This action also handles the caching of the Yarn dependencies.
# https://github.com/actions/setup-node
- name: Set up node and enable caching of dependencies
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: './.nvmrc'
cache: 'yarn'
- name: Yarn install
run: yarn install
- name: Show debug info
run: |
npm --version
node --version
yarn --version
grunt --version
yarn run jest --version
- name: Build all packages
run: yarn run build --ignore "@yoast/wordpress-seo"
- name: Show Jest version
run: yarn run jest --version
working-directory: packages/${{ matrix.package }}
- name: Show Config
run: yarn test --showConfig
working-directory: packages/${{ matrix.package }}
- name: Run Javascript tests
run: yarn test --ci --coverage
working-directory: packages/${{ matrix.package }}
- name: Upload coverage results to Coveralls
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
env:
COVERALLS_SERVICE_NUMBER: ${{ github.sha }} # Connect all builds together.
with:
flag-name: package-${{ matrix.package }}
parallel: true
#########################################################################################
# For packages in this job, PRs will only run the tests related to changed files
# to make the build faster.
# For merges and pushes to select branches, the full test suite is still run.
# Packages should (only) be moved to this job if the full test run is exceedingly slow.
#########################################################################################
yarn-test-onlyChanged:
runs-on: ubuntu-latest
strategy:
# As these packages are all unique, don't stop the workflow when the test run of one package fails.
fail-fast: false
matrix:
include:
- package: 'yoastseo'
needs_premium_config: true
name: "TestJS - ${{ matrix.package }}${{ github.event_name == 'pull_request' && ' (onlyChanged)' || ' (full)' }}"
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Checks for changes
uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # dorny/paths-filter@v4.0.2
id: changes
with:
filters: |
src:
- 'packages/${{ matrix.package }}/**'
# For pull requests, only run the full tests when touching this package.
- name: Checks if tests should be run
id: checks-run
run: |
echo "should=${{ github.event_name != 'pull_request' || steps.changes.outputs.src == 'true' }}" >> "$GITHUB_OUTPUT"
# Check out the premium config repo ahead of running the tests to prevent issues with permissions.
- name: Checkout premium configuration
if: ${{ steps.checks-run.outputs.should == 'true' && matrix.needs_premium_config == true }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: Yoast/YoastSEO.js-premium-configuration
path: packages/yoastseo/premium-configuration
fetch-depth: 0
token: ${{ secrets.YOASTBOT_CI_PAT_DIST }}
persist-credentials: true
# The ubuntu images come with Node, npm and yarn pre-installed.
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
# This action also handles the caching of the Yarn dependencies.
# https://github.com/actions/setup-node
- name: Set up node and enable caching of dependencies
if: ${{ steps.checks-run.outputs.should == 'true' }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: './.nvmrc'
cache: 'yarn'
- name: Yarn install
if: ${{ steps.checks-run.outputs.should == 'true' }}
run: yarn install
- name: Show debug info
if: ${{ steps.checks-run.outputs.should == 'true' }}
run: |
npm --version
node --version
yarn --version
grunt --version
yarn run jest --version
- name: Build all packages
if: ${{ steps.checks-run.outputs.should == 'true' }}
run: yarn run build --ignore "@yoast/wordpress-seo"
- name: Show Jest version
if: ${{ steps.checks-run.outputs.should == 'true' }}
run: yarn run jest --version
working-directory: packages/${{ matrix.package }}
- name: Show Config
if: ${{ steps.checks-run.outputs.should == 'true' }}
run: yarn test --showConfig
working-directory: packages/${{ matrix.package }}
- name: Run Javascript tests
if: ${{ steps.checks-run.outputs.should == 'true' }}
run: yarn test --ci --coverage
working-directory: packages/${{ matrix.package }}
- name: Upload coverage results to Coveralls
if: ${{ steps.checks-run.outputs.should == 'true' }}
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
env:
COVERALLS_SERVICE_NUMBER: ${{ github.sha }} # Connect all builds together.
with:
flag-name: package-${{ matrix.package }}
parallel: true
#########################################################################################
# React 19 compatibility leg: run a package's tests against the React version that
# WordPress 7.1 / the Gutenberg 23.3 RC ships (19.2.4), in addition to the default
# React 18.3 run in `yarn-test-full`. Scoped to ui-library for now; add packages to the
# matrix as they become React-19-ready (e.g. once `components` drops react-test-renderer).
#########################################################################################
yarn-test-react19:
runs-on: ubuntu-latest
strategy:
# Each package/version is independent; don't stop the others when one fails.
fail-fast: false
matrix:
package:
- 'ui-library'
react:
- '19.2.4'
name: "TestJS - ${{ matrix.package }} (React ${{ matrix.react }})"
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up node and enable caching of dependencies
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: './.nvmrc'
cache: 'yarn'
# Force the target React across every workspace via a yarn resolution, then install.
# A plain `yarn add -W` would not override packages that pin react@^18 in their own
# dependencies; `resolutions` overrides every range. @testing-library/react v16
# supports both React 18 and 19, so it is left untouched.
- name: Force React ${{ matrix.react }}
env:
REACT_VERSION: ${{ matrix.react }}
run: |
node -e "const fs = require('fs'); const p = JSON.parse(fs.readFileSync('package.json', 'utf8')); const v = process.env.REACT_VERSION; p.resolutions = { ...(p.resolutions || {}), react: v, 'react-dom': v }; fs.writeFileSync('package.json', JSON.stringify(p, null, 2));"
yarn install --force
- name: Run Javascript tests
run: yarn test --ci
working-directory: packages/${{ matrix.package }}