Skip to content

Commit f9a368e

Browse files
committed
move component checks to components-pr workflow
1 parent 0e94b00 commit f9a368e

File tree

2 files changed

+47
-14
lines changed

2 files changed

+47
-14
lines changed

.github/workflows/components-pr.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,53 @@ jobs:
4242
base_commit: ${{ github.event.pull_request.base.sha }}
4343
head_commit: ${{ github.event.pull_request.head.sha }}
4444

45+
check_components:
46+
name: Check component keys and app props
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- name: Checkout Code
51+
uses: actions/[email protected]
52+
with:
53+
# Full git history is needed to get a proper list of changed files
54+
# within `super-linter`
55+
fetch-depth: 0
56+
- uses: pnpm/[email protected]
57+
with:
58+
version: 7.33.6
59+
- name: Get pnpm store directory
60+
id: pnpm-cache
61+
run: |
62+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
63+
- uses: actions/cache@v4
64+
name: Setup pnpm cache
65+
with:
66+
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
67+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
68+
restore-keys: |
69+
${{ runner.os }}-pnpm-store-
70+
- name: Install dependencies
71+
run: pnpm install -r
72+
- name: Setup Node Env
73+
uses: actions/[email protected]
74+
with:
75+
node-version: 18
76+
registry-url: https://registry.npmjs.org/
77+
cache: 'pnpm'
78+
- name: Compile TypeScript
79+
run: npm run build
80+
- name: Get Changed Files
81+
id: changed_files
82+
uses: jitterbit/get-changed-files@v1
83+
with:
84+
format: 'csv'
85+
- name: Check component keys
86+
run: node scripts/findBadKeys.js ${{ steps.changed_files.outputs.added_modified }} ${{ steps.changed_files.outputs.renamed }}
87+
- name: Check component app prop
88+
run: node scripts/checkComponentAppProp.js ${{ steps.changed_files.outputs.added_modified }} ${{ steps.changed_files.outputs.renamed }}
89+
- name: Check for duplicate component keys
90+
run: node scripts/findDuplicateKeys.js
91+
4592
verify-typescript-components:
4693
name: Verify TypeScript components
4794
runs-on: ubuntu-latest

.github/workflows/pull-request-checks.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ jobs:
7575
node-version: 18
7676
registry-url: https://registry.npmjs.org/
7777
cache: 'pnpm'
78-
- name: Compile TypeScript
79-
run: npm run build
8078
- name: Lint Code Base
8179
uses: github/super-linter@v5
8280
env:
@@ -87,15 +85,3 @@ jobs:
8785
VALIDATE_ALL_CODEBASE: false
8886
VALIDATE_JAVASCRIPT_ES: true
8987
VALIDATE_JSON: true
90-
- name: Get Changed Files
91-
id: changed_files
92-
uses: jitterbit/get-changed-files@v1
93-
with:
94-
format: 'csv'
95-
# TODO: Move these checks to the Components workflow
96-
- name: Check component keys
97-
run: node scripts/findBadKeys.js ${{ steps.changed_files.outputs.added_modified }} ${{ steps.changed_files.outputs.renamed }}
98-
- name: Check component app prop
99-
run: node scripts/checkComponentAppProp.js ${{ steps.changed_files.outputs.added_modified }} ${{ steps.changed_files.outputs.renamed }}
100-
- name: Check for duplicate component keys
101-
run: node scripts/findDuplicateKeys.js

0 commit comments

Comments
 (0)