Button markup #54
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Jest | |
on: | |
pull_request: | |
merge_group: | |
# This allows a subsequently queued workflow run to interrupt previous runs | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
file-diff: | |
runs-on: ubuntu-22.04 | |
name: File Diff | |
if: startsWith( github.repository, 'elementor/' ) | |
outputs: | |
js_diff: ${{ steps.js_diff_files.outputs.diff }} | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Check JS files diff | |
id: js_diff_files | |
uses: technote-space/get-diff-action@v6 | |
with: | |
PATTERNS: | | |
**/*.+(js|ts|json|jsx|tsx) | |
package*.json | |
.github/**/*.yml | |
jest: | |
runs-on: ubuntu-22.04 | |
needs: [ 'file-diff' ] | |
if: ${{ needs.file-diff.outputs.js_diff || github.event.pull_request.title == null }} | |
name: Test | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Install Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- uses: actions/cache@v4 | |
id: npm-cache | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Dependencies | |
run: npm ci | |
- name: "Run Jest" | |
run: npm run test:jest |