From 52bb6e12241ad7e76e4b2a73171ed263cb391e54 Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Thu, 4 Apr 2024 13:22:27 -0700 Subject: [PATCH 01/13] chore: remove legacy test_app_build action --- .github/workflows/test-app-build.yml | 111 --------------------------- 1 file changed, 111 deletions(-) delete mode 100644 .github/workflows/test-app-build.yml diff --git a/.github/workflows/test-app-build.yml b/.github/workflows/test-app-build.yml deleted file mode 100644 index 7da7db3915..0000000000 --- a/.github/workflows/test-app-build.yml +++ /dev/null @@ -1,111 +0,0 @@ -################################################################################## -# About -################################################################################## -# Reuseable workflow to be called from content repos. -# Allows for parent repo. -# Must specify all below secrets and variables - see documentation for details -# -# Version : 1.0 -# -################################################################################## -# Configuration -################################################################################## -env: - DEPLOYMENT_NAME: ${{vars.DEPLOYMENT_NAME}} - APP_CODE_BRANCH: ${{vars.APP_CODE_BRANCH}} - PARENT_DEPLOYMENT_REPO: ${{vars.PARENT_DEPLOYMENT_REPO}} - PARENT_DEPLOYMENT_NAME: ${{vars.PARENT_DEPLOYMENT_NAME}} - PARENT_DEPLOYMENT_BRANCH: ${{vars.PARENT_DEPLOYMENT_BRANCH}} - DEPLOYMENT_PRIVATE_KEY: ${{secrets.DEPLOYMENT_PRIVATE_KEY}} - FIREBASE_CONFIG: ${{secrets.FIREBASE_CONFIG}} - -################################################################################## -# Main Code -################################################################################## -name: Build App - -# Only keep one active build per ref (e.g. pr branch, push branch, triggering workflow ref) -concurrency: - group: app-build-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - workflow_call: - inputs: - artifact-name: - description: Name of the artifact to upload - type: string - default: www - build-flags: - description: Additional flags to pass to build command (e.g. base-href) - type: string - default: "" - branch: - description: Name of branch to build (defaults to event trigger sha) - type: string - default: "" - - outputs: - GIT_SHA: - description: "Git SHA of build head" - value: ${{ jobs.configure_build.outputs.GIT_SHA }} - -jobs: - build: - outputs: - GIT_SHA: ${{ steps.populate.outputs.GIT_SHA }} - - runs-on: ubuntu-latest - steps: - - name: Check out app code - uses: actions/checkout@v3 - with: - repository: "IDEMSInternational/parenting-app-ui.git" - ref: ${{env.APP_CODE_BRANCH}} - - - name: Checkout parent repo if needed - if: env.PARENT_DEPLOYMENT_REPO != '' - uses: actions/checkout@v3 - with: - path: ".idems_app/deployments/${{env.PARENT_DEPLOYMENT_NAME}}" - repository: ${{env.PARENT_DEPLOYMENT_REPO}} - ref: ${{env.PARENT_DEPLOYMENT_BRANCH}} - - - name: Checkout deployment - uses: actions/checkout@v3 - with: - ref: ${{inputs.branch}} - path: ".idems_app/deployments/${{env.DEPLOYMENT_NAME}}" - - - name: Populate Encryption key - if: env.DEPLOYMENT_PRIVATE_KEY != '' - run: echo "${{env.DEPLOYMENT_PRIVATE_KEY}}" > ./.idems_app/deployments/${{env.DEPLOYMENT_NAME}}/encrypted/private.key - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.x - - - name: Cache node modules - uses: actions/cache@v3 - with: - path: ./.yarn/cache - # If cachebusting required (e.g. breaking yarn changes on update) change `v1` to another number - key: ${{ runner.os }}-node-modules-yarn-v1-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-node-modules-yarn-v1- - - - name: Install node modules - run: yarn install - - - name: Set deployment - run: yarn workflow deployment set $DEPLOYMENT_NAME - - - name: Build - run: yarn build ${{inputs.build-flags}} - - - name: Upload artifact - uses: actions/upload-pages-artifact@v1.0.8 - with: - path: "www/" - name: ${{inputs.artifact-name}} From c5a61b5b496b0a3d1b055edf706cbd16b3fa1686 Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Thu, 4 Apr 2024 13:54:15 -0700 Subject: [PATCH 02/13] refactor: wip web-build refactor --- .github/workflows/web-build.yml | 51 +++++++-------------------------- 1 file changed, 10 insertions(+), 41 deletions(-) diff --git a/.github/workflows/web-build.yml b/.github/workflows/web-build.yml index 565a90622e..91b269db06 100644 --- a/.github/workflows/web-build.yml +++ b/.github/workflows/web-build.yml @@ -3,10 +3,9 @@ # These variables will be populated from environment ################################################################################## env: - DEPLOYMENT_NAME_DEFAULT: debug DEPLOYMENT_REPO: ${{vars.DEPLOYMENT_REPO}} - DEPLOYMENT_PRIVATE_KEY: ${{secrets.DEPLOYMENT_PRIVATE_KEY}} - FIREBASE_CONFIG_TS: ${{secrets.FIREBASE_CONFIG_TS}} + DEPLOYMENT_NAME: ${{vars.DEPLOYMENT_NAME}} + DEPLOYMENT_REPO_PRIVATE_KEY: ${{secrets.DEPLOYMENT_PRIVATE_KEY}} ################################################################################## # Main Code @@ -25,6 +24,10 @@ on: # Optional variables to configure from parent workflow via workflow_call ############################################################################# inputs: + deployment-env: + description: Name of environment to load deployment variables from + required: true + default: debug build-flags: description: Additional flags to pass to build command (e.g. base-href) type: string @@ -33,12 +36,6 @@ on: description: Name of branch to build (defaults to event trigger sha) type: string default: "" - deployment: - description: | - Target deployment name. If branch name provided will take suffix (`prod/my_deployment` -> `my_deployment`). - Will load variables from named deployment environment - type: string - default: "" include-tests: description: "Specify whether to include running workspace lint and test before build" type: boolean @@ -64,17 +61,9 @@ on: value: ${{ jobs.configure_build.outputs.GIT_SHA }} jobs: - ############################################################################# - # configure Build - # Deployment-specific variables are loaded from deployment name environment contexts - # stored on github actions. - # Determine which set of environment variables to load, depending on passed inputs, - # target branch names or default fallback - # Populate variables to use as inputs in next build job - # Pattern found in this question: https://github.com/actions/runner/issues/998#issue-817330769 - # Outputs here will also be made available to parent workflows via workflow_call outputs - ############################################################################# + configure_build: + environment: ${{inputs.deployment-env}} outputs: DEPLOYMENT_NAME: ${{ steps.populate.outputs.DEPLOYMENT_NAME }} GIT_SHA: ${{ steps.populate.outputs.GIT_SHA }} @@ -84,24 +73,6 @@ jobs: with: ref: ${{inputs.branch}} - - name: Set named input environment - if: ${{ inputs.environment }} - run: | - echo "DEPLOYMENT_NAME=${{inputs.environment}}" >> $GITHUB_ENV; - shell: bash - - - name: Set environment from target - if: ${{inputs.deployment && inputs.deployment != 'master' && inputs.deployment!='refs/heads/master'}} - run: | - echo "DEPLOYMENT_NAME=$(echo ${{inputs.deployment}} | sed 's/.*\///')" >> $GITHUB_ENV; - shell: bash - - - name: Set default environment - if: ${{ !env.DEPLOYMENT_NAME }} - run: | - echo "DEPLOYMENT_NAME=$DEPLOYMENT_NAME_DEFAULT" >> $GITHUB_ENV; - shell: bash - # Output determined environment name alongside git SHA (for use in error logging) - name: Populate Outputs id: populate @@ -116,7 +87,6 @@ jobs: environment: ${{needs.configure_build.outputs.DEPLOYMENT_NAME}} env: GIT_SHA: ${{ needs.configure_build.outputs.GIT_SHA }} - DEPLOYMENT_NAME: ${{ needs.configure_build.outputs.DEPLOYMENT_NAME }} steps: - uses: actions/checkout@v3 with: @@ -161,7 +131,6 @@ jobs: run: echo "export const GIT_SHA = \"$GIT_SHA\";" > src/environments/sha.ts - name: Import remote deployment - if: ${{env.DEPLOYMENT_REPO}} uses: actions/checkout@v3 with: repository: ${{env.DEPLOYMENT_REPO}} @@ -170,9 +139,9 @@ jobs: # TODO - add support for specific branch/release - name: Set deployment private key - if: ${{env.DEPLOYMENT_PRIVATE_KEY}} + if: ${{env.DEPLOYMENT_REPO_PRIVATE_KEY}} run: - echo $DEPLOYMENT_PRIVATE_KEY > .idems_app/deployments/$DEPLOYMENT_NAME/encrypted/private.key + echo $DEPLOYMENT_REPO_PRIVATE_KEY > .idems_app/deployments/$DEPLOYMENT_NAME/encrypted/private.key - name: Set deployment run: yarn workflow deployment set ${{env.DEPLOYMENT_NAME}} From 5f2a914a50cbede9241c71a3fabce231f2481ac5 Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Thu, 4 Apr 2024 13:54:35 -0700 Subject: [PATCH 03/13] chore: deprecate shared deployment hosting github action --- .github/workflows/{ => deprecated}/deployment-hosting.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ => deprecated}/deployment-hosting.yml (100%) diff --git a/.github/workflows/deployment-hosting.yml b/.github/workflows/deprecated/deployment-hosting.yml similarity index 100% rename from .github/workflows/deployment-hosting.yml rename to .github/workflows/deprecated/deployment-hosting.yml From 11337e45c742b04b3badfa544cd11e5bd5df35b0 Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Thu, 4 Apr 2024 13:58:52 -0700 Subject: [PATCH 04/13] chore: code tidying --- .github/workflows/test-build.yml | 2 +- .github/workflows/test-preview.yml | 12 ++---------- .github/workflows/test-visual.yml | 9 +++------ .github/workflows/web-build.yml | 1 + 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 5c825701a7..9e8ffdcbd2 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -13,4 +13,4 @@ jobs: skip-upload: true # When testing build binary assets not required lfs: false - deployment: debug \ No newline at end of file + deployment-env: debug \ No newline at end of file diff --git a/.github/workflows/test-preview.yml b/.github/workflows/test-preview.yml index 2fccc3b6b7..be8990c32a 100644 --- a/.github/workflows/test-preview.yml +++ b/.github/workflows/test-preview.yml @@ -1,17 +1,11 @@ -# Deploy preview url for labelled PRs -# Specifies deployment target based on pr target branch -# Master -> debug -# Deployment/{deployment_name} -> {deployment_name} - name: Deployment Preview on: pull_request: types: [labeled, synchronize] branches: - - deployment/* - master concurrency: - group: deployment-preview-${{ github.workflow }}-${{ github.ref }} + group: test-preview-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: @@ -20,9 +14,7 @@ jobs: secrets: inherit with: build-flags: --configuration "production,preview" - # use branch name from PR target as default - # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables - deployment: ${{ github.base_ref }} + deployment-env: debug deploy_preview: needs: build diff --git a/.github/workflows/test-visual.yml b/.github/workflows/test-visual.yml index 0ae0cab61f..b14365fa69 100644 --- a/.github/workflows/test-visual.yml +++ b/.github/workflows/test-visual.yml @@ -1,7 +1,3 @@ -env: - # TODO: create a dedicated screenshots deployment - DEPLOYMENT: debug - # Generate a set of screenshots for the current branch and compare against previously generated on master name: Test-Visual on: @@ -24,9 +20,10 @@ jobs: uses: ./.github/workflows/web-build.yml secrets: inherit with: - deployment: $DEPLOYMENT + # TODO: create a dedicated screenshots env + deployment-env: debug - test_visual_compare: + test_visual: needs: build runs-on: ubuntu-latest timeout-minutes: 60 diff --git a/.github/workflows/web-build.yml b/.github/workflows/web-build.yml index 91b269db06..450374837b 100644 --- a/.github/workflows/web-build.yml +++ b/.github/workflows/web-build.yml @@ -26,6 +26,7 @@ on: inputs: deployment-env: description: Name of environment to load deployment variables from + type: string required: true default: debug build-flags: From bc4da41264c6fae9e26896a4d92d361736f07c14 Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Thu, 4 Apr 2024 14:46:31 -0700 Subject: [PATCH 05/13] chore: ci --- .github/workflows/test-preview.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-preview.yml b/.github/workflows/test-preview.yml index be8990c32a..1b228e9eec 100644 --- a/.github/workflows/test-preview.yml +++ b/.github/workflows/test-preview.yml @@ -1,3 +1,9 @@ +env: + # Actions environment to load for secrets and variables + # See child web-build action for vars and secrets required + DEPLOYMENT_ENV: DEBUG + FIREBASE_HOSTING_TARGET: ${{vars.FIREBASE_HOSTING_TARGET}} + name: Deployment Preview on: pull_request: @@ -14,11 +20,12 @@ jobs: secrets: inherit with: build-flags: --configuration "production,preview" - deployment-env: debug + deployment-env: $DEPLOYMENT_ENV deploy_preview: needs: build runs-on: ubuntu-latest + environment: $DEPLOYMENT_ENV steps: - uses: actions/checkout@v3 - name: Download Build Artifact @@ -29,12 +36,18 @@ jobs: run: | mkdir www tar -xf artifact.tar --directory www + # HACK - although deployments set their firebase.json from config the file is + # not passed back from artifact so hardcode via action + - name: Populate firebase.json + run: | + cp firebase.template.json firebase.json + sed -i 's/${FIREBASE_HOSTING_TARGET}/${{ env.FIREBASE_HOSTING_TARGET }}/g' firebase.json - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: "${{ secrets.GITHUB_TOKEN }}" firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_PLH_TEENS_APP1 }}" projectId: plh-teens-app1 - target: "${{needs.build.outputs.DEPLOYMENT_NAME}}" + target: "${{env.FIREBASE_HOSTING_TARGET}}" expires: 14d env: FIREBASE_CLI_PREVIEWS: hostingchannels From 509829d203f539a41c3e8e32db6f06a906c5900b Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Thu, 4 Apr 2024 14:51:36 -0700 Subject: [PATCH 06/13] chore: ci --- .github/workflows/test-preview.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-preview.yml b/.github/workflows/test-preview.yml index 1b228e9eec..85596d5519 100644 --- a/.github/workflows/test-preview.yml +++ b/.github/workflows/test-preview.yml @@ -20,12 +20,12 @@ jobs: secrets: inherit with: build-flags: --configuration "production,preview" - deployment-env: $DEPLOYMENT_ENV + deployment-env: ${{env.DEPLOYMENT_ENV}} deploy_preview: needs: build runs-on: ubuntu-latest - environment: $DEPLOYMENT_ENV + environment: ${{env.DEPLOYMENT_ENV}} steps: - uses: actions/checkout@v3 - name: Download Build Artifact From 01884911fa0cdd3486116ff5ad3c76e554c907f5 Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Thu, 4 Apr 2024 14:54:54 -0700 Subject: [PATCH 07/13] chore: ci --- .github/workflows/test-preview.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-preview.yml b/.github/workflows/test-preview.yml index 85596d5519..273568c73e 100644 --- a/.github/workflows/test-preview.yml +++ b/.github/workflows/test-preview.yml @@ -25,7 +25,8 @@ jobs: deploy_preview: needs: build runs-on: ubuntu-latest - environment: ${{env.DEPLOYMENT_ENV}} + environment: + name: ${{github.env.DEPLOYMENT_ENV}} steps: - uses: actions/checkout@v3 - name: Download Build Artifact From 2a7eae3f21cf787485fc3501f50f242625bc6a5f Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Thu, 4 Apr 2024 14:55:36 -0700 Subject: [PATCH 08/13] chore: ci --- .github/workflows/test-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-preview.yml b/.github/workflows/test-preview.yml index 273568c73e..e6eb7fca4b 100644 --- a/.github/workflows/test-preview.yml +++ b/.github/workflows/test-preview.yml @@ -20,7 +20,7 @@ jobs: secrets: inherit with: build-flags: --configuration "production,preview" - deployment-env: ${{env.DEPLOYMENT_ENV}} + deployment-env: ${{github.env.DEPLOYMENT_ENV}} deploy_preview: needs: build From 689895ec21c1bd27afe59d1554b9d16009af5dbf Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Thu, 4 Apr 2024 14:59:52 -0700 Subject: [PATCH 09/13] chore: ci --- .github/workflows/test-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-preview.yml b/.github/workflows/test-preview.yml index e6eb7fca4b..1b477d20c9 100644 --- a/.github/workflows/test-preview.yml +++ b/.github/workflows/test-preview.yml @@ -1,7 +1,7 @@ env: # Actions environment to load for secrets and variables # See child web-build action for vars and secrets required - DEPLOYMENT_ENV: DEBUG + DEPLOYMENT_ENV: debug FIREBASE_HOSTING_TARGET: ${{vars.FIREBASE_HOSTING_TARGET}} name: Deployment Preview From 27244b17a541fac2e44c5cad58042fb374d1b83a Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Thu, 4 Apr 2024 15:00:53 -0700 Subject: [PATCH 10/13] chore: ci --- .github/workflows/test-preview.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-preview.yml b/.github/workflows/test-preview.yml index 1b477d20c9..9198314e54 100644 --- a/.github/workflows/test-preview.yml +++ b/.github/workflows/test-preview.yml @@ -1,7 +1,6 @@ env: # Actions environment to load for secrets and variables # See child web-build action for vars and secrets required - DEPLOYMENT_ENV: debug FIREBASE_HOSTING_TARGET: ${{vars.FIREBASE_HOSTING_TARGET}} name: Deployment Preview @@ -20,13 +19,13 @@ jobs: secrets: inherit with: build-flags: --configuration "production,preview" - deployment-env: ${{github.env.DEPLOYMENT_ENV}} + deployment-env: debug deploy_preview: needs: build runs-on: ubuntu-latest environment: - name: ${{github.env.DEPLOYMENT_ENV}} + name: debug steps: - uses: actions/checkout@v3 - name: Download Build Artifact From 9e6777eed710b3da0e4c78d37c79bc072d759baf Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Thu, 4 Apr 2024 15:15:26 -0700 Subject: [PATCH 11/13] chore: ci --- .github/workflows/test-preview.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-preview.yml b/.github/workflows/test-preview.yml index 9198314e54..da2ac5afa6 100644 --- a/.github/workflows/test-preview.yml +++ b/.github/workflows/test-preview.yml @@ -2,6 +2,7 @@ env: # Actions environment to load for secrets and variables # See child web-build action for vars and secrets required FIREBASE_HOSTING_TARGET: ${{vars.FIREBASE_HOSTING_TARGET}} + FIREBASE_PROJECT_ID: ${{vars.FIREBASE_PROJECT_ID}} name: Deployment Preview on: @@ -24,8 +25,7 @@ jobs: deploy_preview: needs: build runs-on: ubuntu-latest - environment: - name: debug + environment: debug steps: - uses: actions/checkout@v3 - name: Download Build Artifact @@ -38,15 +38,18 @@ jobs: tar -xf artifact.tar --directory www # HACK - although deployments set their firebase.json from config the file is # not passed back from artifact so hardcode via action - - name: Populate firebase.json + - name: Populate firebase config run: | cp firebase.template.json firebase.json sed -i 's/${FIREBASE_HOSTING_TARGET}/${{ env.FIREBASE_HOSTING_TARGET }}/g' firebase.json + cp .template.firebaserc .firebaserc + sed -i 's/${FIREBASE_HOSTING_TARGET}/${{ env.FIREBASE_HOSTING_TARGET }}/g' .firebaserc + sed -i 's/${FIREBASE_PROJECT_ID}/${{ env.FIREBASE_PROJECT_ID }}/g' .firebaserc - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: "${{ secrets.GITHUB_TOKEN }}" firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_PLH_TEENS_APP1 }}" - projectId: plh-teens-app1 + projectId: ${{env.FIREBASE_PROJECT_ID}} target: "${{env.FIREBASE_HOSTING_TARGET}}" expires: 14d env: From 62a0598a054b525236b088c2e966a92386797483 Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Thu, 4 Apr 2024 15:24:04 -0700 Subject: [PATCH 12/13] chore: code tidying --- .github/workflows/test-preview.yml | 2 +- .github/workflows/web-build.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-preview.yml b/.github/workflows/test-preview.yml index da2ac5afa6..61e1552aaf 100644 --- a/.github/workflows/test-preview.yml +++ b/.github/workflows/test-preview.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest environment: debug steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Download Build Artifact uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/web-build.yml b/.github/workflows/web-build.yml index 450374837b..e317a1535f 100644 --- a/.github/workflows/web-build.yml +++ b/.github/workflows/web-build.yml @@ -70,7 +70,7 @@ jobs: GIT_SHA: ${{ steps.populate.outputs.GIT_SHA }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{inputs.branch}} @@ -89,7 +89,7 @@ jobs: env: GIT_SHA: ${{ needs.configure_build.outputs.GIT_SHA }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: lfs: ${{inputs.lfs}} ref: ${{inputs.branch}} @@ -132,7 +132,7 @@ jobs: run: echo "export const GIT_SHA = \"$GIT_SHA\";" > src/environments/sha.ts - name: Import remote deployment - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ${{env.DEPLOYMENT_REPO}} lfs: ${{inputs.lfs}} From 4824e5283d77fa5fc90170f0dae9b0326eac386a Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Thu, 4 Apr 2024 18:45:03 -0700 Subject: [PATCH 13/13] chore: code tidying --- .github/workflows/test-visual.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-visual.yml b/.github/workflows/test-visual.yml index b14365fa69..35b4f688da 100644 --- a/.github/workflows/test-visual.yml +++ b/.github/workflows/test-visual.yml @@ -28,16 +28,14 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - ########################################################################################### - # Setup - ########################################################################################### - - uses: actions/checkout@v3 - + ########################################################################################### + # Setup + ########################################################################################### + - uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v3 with: - node-version: 18.x - + node-version: 18.x - uses: actions/cache/restore@v3 id: cache with: @@ -45,10 +43,17 @@ jobs: key: ${{ runner.os }}-node-modules-yarn-v1-${{ hashFiles('yarn.lock') }} restore-keys: | ${{ runner.os }}-node-modules-yarn-v1- - - name: Install node modules run: yarn install --immutable + - uses: actions/cache/save@v3 + if: steps.cache.outputs.cache-hit != 'true' + with: + path: ./.yarn/cache + key: ${{ runner.os }}-node-modules-yarn-v1-${{ hashFiles('yarn.lock') }} + ############################################################################# + # Download build + ############################################################################# - name: Download Build Artifact uses: actions/download-artifact@v3 with: @@ -61,10 +66,10 @@ jobs: # HACK - as lifecycle_actions block template view simply remove them all # TODO - review if still required (CC 2023-08-15) - - name : HACK - Remove lifecycle actions + - name: HACK - Remove lifecycle actions run: | rm -f -R www/assets/app_data/sheets/data_list/lifecycle_actions - + ########################################################################################### # Generate ########################################################################################### @@ -80,7 +85,7 @@ jobs: path: packages/test-visual/output/screenshots retention-days: 90 if-no-files-found: error - + ########################################################################################### # Compare ########################################################################################### @@ -138,7 +143,6 @@ jobs: **Run Details** https://github.com/IDEMSInternational/parenting-app-ui/actions/runs/${{github.run_id}} - # Alt implementation to DL artifact using action instead of download script # Download artifact populated from latest `test-visual-generate` workflow run on master branch