Skip to content

Commit

Permalink
Test that React components are updated in CMS
Browse files Browse the repository at this point in the history
Check that the version.json file is different before and after updating
components.

We can do this by comparing version.json files.
  • Loading branch information
kasperg committed Dec 5, 2023
1 parent 4140405 commit c19c30f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,29 @@ jobs:
# a difference. Reverse this using !.
run: |
! diff ${{ runner.temp }}/design-system/base.before.css ${{ runner.temp }}/design-system/base.after.css
- name: Store info on current build of React components in CMS
run: |
mkdir ${{ runner.temp }}/react
docker compose cp php:app/web/libraries/dpl-react/version.json ${{ runner.temp }}/react/version.before.json
working-directory: cms
- name: Update React component
run: |
echo -e "\nconsole.log('Hello world!');\n" >> src/apps/hello-world/hello-world.tsx
working-directory: react
- name: Build React components for CMS
# Normally this would happen automatically through file watchers when
# files are changed. We are not running with file watchers in GitHub
# actions so updated links to the CMS automatically.
run: "task cms:link ${{ env.TASK_OUTPUT }}"
- name: Store new build of React components in CMS
run: |
docker compose cp php:app/web/libraries/dpl-react/version.json ${{ runner.temp }}/react/version.after.json
working-directory: cms
- name: Ensure there is a difference between React builds in CMS
# We expect a difference and diff will return an error code if there is
# a difference. Reverse this using !.
run: |
! diff ${{ runner.temp }}/react/version.before.json ${{ runner.temp }}/react/version.after.json
- name: Reset environment
run: "task reset ${{ env.TASK_OUTPUT }}"
- name: Setup tmate session to support debugging if enabled
Expand Down

0 comments on commit c19c30f

Please sign in to comment.