@@ -85,13 +85,15 @@ jobs:
8585 styles_modified_files : ${{ steps.changed-files.outputs.styles_modified_files }}
8686 eslint_added_files : ${{ steps.changed-files.outputs.eslint_added_files }}
8787 eslint_modified_files : ${{ steps.changed-files.outputs.eslint_modified_files }}
88+ plugins_modified_files : ${{ steps.changed-files.outputs.plugins_modified_files }}
89+ plugins_added_files : ${{ steps.changed-files.outputs.plugins_added_files }}
8890 permissions :
8991 pull-requests : read
9092
9193 steps :
9294 - name : Get changed files
9395 id : changed-files
94- uses : tj-actions/changed-files@v44
96+ uses : tj-actions/changed-files@v45
9597 with :
9698 files_yaml : |
9799 styles:
@@ -100,6 +102,8 @@ jobs:
100102 - components/*/themes/express.css
101103 eslint:
102104 - components/*/stories/*.js
105+ plugins:
106+ - plugins/**/*
103107
104108 # -------------------------------------------------------------
105109 # Lint pre-compiled assets for consistency
@@ -116,6 +120,49 @@ jobs:
116120 eslint_modified_files : ${{ needs.changed_files.outputs.eslint_modified_files }}
117121 secrets : inherit
118122
123+ # -------------------------------------------------------------
124+ # Run the test suites for the plugins if there are changes
125+ # to any of the plugin files
126+ # -------------------------------------------------------------
127+ plugin_tests :
128+ name : Plugin tests
129+ runs-on : ubuntu-latest
130+ needs : [changed_files]
131+ if : ${{ needs.changed_files.outputs.plugins_added_files != '' || needs.changed_files.outputs.plugins_modified_files != '' }}
132+ steps :
133+ - name : Check out code
134+ uses : actions/checkout@v4
135+
136+ - name : Use Node LTS version
137+ uses : actions/setup-node@v4
138+ with :
139+ node-version : 20
140+ cache : yarn
141+
142+ - name : Enable Corepack
143+ run : corepack enable
144+
145+ # # --- YARN CACHE --- ##
146+ - name : Check for cached dependencies
147+ continue-on-error : true
148+ id : cache-dependencies
149+ uses : actions/cache@v4
150+ with :
151+ path : |
152+ .cache/yarn
153+ node_modules
154+ key : ubuntu-latest-node20-${{ hashFiles('yarn.lock') }}
155+
156+ # # --- INSTALL --- ##
157+ # If statement isn't needed here b/c yarn will leverage the cache if it exists
158+ - name : Install dependencies
159+ shell : bash
160+ run : yarn install --immutable
161+
162+ # # --- Run plugins test suites --- ##
163+ - name : Run plugin tests
164+ run : yarn test:plugins
165+
119166 # -------------------------------------------------------------
120167 # RUN VISUAL REGRESSION TESTS --- #
121168 # Run VRT on:
@@ -142,14 +189,8 @@ jobs:
142189 # -------------------------------------------------------------
143190 publish_site :
144191 name : Publish
145- # The build step ensures we are leveraging the cache for the build
146- needs : [vrt]
147- # Note: the goal here is to allow vrt to be skipped but still require the build to succeed
148- if : ${{ always() }}
149192 uses : ./.github/workflows/publish-site.yml
150193 with :
151194 deploy-message : ${{ github.event.pull_request.title }}
152195 alias : pr-${{ github.event.number }}
153- # Only pass the storybook url if the vrt was successful
154- storybook-url : ${{ needs.vrt.outputs.storybook-url || '' }}
155196 secrets : inherit
0 commit comments