From 1ce47e2377e505109e5c358e3b945abb22281c78 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Wed, 3 Jan 2024 12:58:27 -0500 Subject: [PATCH] switch to gha cache --- .github/actions/before-e2e/action.yml | 16 +++++------ .github/workflows/pull-request.yml | 38 ++++++++++++++++++++++----- 2 files changed, 39 insertions(+), 15 deletions(-) diff --git a/.github/actions/before-e2e/action.yml b/.github/actions/before-e2e/action.yml index 92cef4f90b..ae658c08c4 100644 --- a/.github/actions/before-e2e/action.yml +++ b/.github/actions/before-e2e/action.yml @@ -34,14 +34,14 @@ runs: shell: bash run: ./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host $BASE_URL -u $ADMIN_EMAIL -p $ADMIN_PASSWORD || exit 1 - - name: Download artifacts - uses: ./.github/actions/download-job-artifact - with: - artifact: ${{ inputs.from }} - output: ${{ inputs.to }} - aws-access-key-id: ${{ inputs.aws-access-key-id }} - aws-secret-access-key: ${{ inputs.aws-secret-access-key }} - aws-region: ${{ inputs.aws-region }} + # - name: Download artifacts + # uses: ./.github/actions/download-job-artifact + # with: + # artifact: ${{ inputs.from }} + # output: ${{ inputs.to }} + # aws-access-key-id: ${{ inputs.aws-access-key-id }} + # aws-secret-access-key: ${{ inputs.aws-secret-access-key }} + # aws-region: ${{ inputs.aws-region }} - name: Install google chrome shell: bash diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 812f8ec0a5..4ff24807ee 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -66,15 +66,23 @@ jobs: - uses: ./.github/actions/before-install - run: npm ci - run: npm run build -- $BUILD_OPTS - - name: upload job artifact + + - name: dist cache if: ${{ success() }} - uses: ./.github/actions/upload-job-artifact + uses: actions/cache@v3 with: - artifact: $CONTENT_CE_DIST_PATH - output: $S3_DBP_FOLDER/alfresco-content-app.tar.bz2 - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ env.AWS_REGION }} + path: $CONTENT_CE_DIST_PATH + key: cache-dist-${{ github.run_id }}-${{ github.run_attempt }} + + # - name: upload job artifact + # if: ${{ success() }} + # uses: ./.github/actions/upload-job-artifact + # with: + # artifact: $CONTENT_CE_DIST_PATH + # output: $S3_DBP_FOLDER/alfresco-content-app.tar.bz2 + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # aws-region: ${{ env.AWS_REGION }} unit-tests: needs: [lint, build] @@ -136,6 +144,13 @@ jobs: cache: 'npm' - uses: ./.github/actions/before-install - run: npm ci + + - uses: actions/cache/restore@v3 + id: cache + with: + path: $CONTENT_CE_DIST_PATH + key: cache-dist-${{ github.run_id }}-${{ github.run_attempt }} + - uses: ./.github/actions/before-e2e with: from: "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" @@ -189,8 +204,16 @@ jobs: with: node-version-file: '.nvmrc' cache: 'npm' + - uses: ./.github/actions/before-install - run: npm ci + + - uses: actions/cache/restore@v3 + id: cache + with: + path: $CONTENT_CE_DIST_PATH + key: cache-dist-${{ github.run_id }}-${{ github.run_attempt }} + - uses: ./.github/actions/before-e2e with: from: "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" @@ -199,6 +222,7 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ env.AWS_REGION }} + - name: before playwright shell: bash run: npx playwright install chromium