From bfb04af628fb734a72412bc3e11bb4945b33a274 Mon Sep 17 00:00:00 2001 From: Tim Cosgrove Date: Tue, 3 Dec 2024 14:23:32 -0800 Subject: [PATCH] Source Cypress from Va-internal S3. (#2373) * Source Cypress from Va-internal S3. * Add Cypress caching path. * Rework and simplify yarn/cypress caching. * Disable use of cache if for cypress container. * Corrected syntax for if. * Add cypress install commands. * Restore removed caching for cypress step. * Restore from main. * Modifying to match vets-website setup more closely. --- .github/workflows/continuous-integration.yml | 17 ++++++++--------- .github/workflows/install/action.yml | 20 +++++++++++--------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index e4a349375a..9abb2ec71c 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -393,20 +393,20 @@ jobs: cypress-tests: name: Cypress E2E Tests - runs-on: [self-hosted, asg] + runs-on: ubuntu-16-cores-latest needs: - login-to-amazon-ecr - build timeout-minutes: 30 container: - image: 008577686731.dkr.ecr.us-gov-west-1.amazonaws.com/cypress-io:node16.13.2-chrome100-ff98 + image: 008577686731.dkr.ecr.us-gov-west-1.amazonaws.com/dsva/cypress-io/cypress/browsers:node16.16.0-chrome107-ff107-edge credentials: username: ${{ needs.login-to-amazon-ecr.outputs.docker_username }} password: ${{ needs.login-to-amazon-ecr.outputs.docker_password }} - options: --user 1001:1001 - volumes: - - /usr/local/share:/share - - /etc/ssl/certs:/etc/ssl/certs + # options: --user 1001:1001 + # volumes: + # - /usr/local/share:/share + # - /etc/ssl/certs:/etc/ssl/certs env: NODE_EXTRA_CA_CERTS: /etc/ssl/certs/ca-certificates.crt @@ -428,13 +428,12 @@ jobs: uses: ./.github/workflows/install timeout-minutes: 30 with: - key: on-demand-runner-cypress-${{ hashFiles('**/yarn.lock') }} - restore-keys: on-demand-runner-cypress- + key: ${{ hashFiles('yarn.lock') }} yarn_cache_folder: .cache/yarn path: | .cache/yarn /github/home/.cache/Cypress - **/node_modules + node_modules - name: Start server run: node src/platform/testing/e2e/test-server.js --buildtype vagovprod --port=3002 & diff --git a/.github/workflows/install/action.yml b/.github/workflows/install/action.yml index d4ea12e20b..db0d15ccff 100644 --- a/.github/workflows/install/action.yml +++ b/.github/workflows/install/action.yml @@ -3,11 +3,11 @@ description: Install dependencies inputs: key: - description: keys for actions/cache@v3 + description: keys for actions/cache@v4 required: false default: '' restore-keys: - description: restore-keys for actions/cache@v3 + description: restore-keys for actions/cache@v4 required: false default: '' yarn_cache_folder: @@ -15,7 +15,7 @@ inputs: required: false default: '' path: - description: path for actions/cache@v3 + description: path for actions/cache@v4 required: false default: '' @@ -28,7 +28,7 @@ runs: run: echo NODE_VERSION=$(cat .nvmrc) >> $GITHUB_OUTPUT - name: Setup Node - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 + uses: actions/setup-node@v4 with: node-version: ${{ steps.get-node-version.outputs.NODE_VERSION }} @@ -38,17 +38,19 @@ runs: - name: Cache dependencies id: cache-dependencies - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + uses: actions/cache@v4 with: path: ${{ inputs.path }} key: ${{ steps.get-node-version.outputs.NODE_VERSION }}-${{ inputs.key }} - restore-keys: ${{ steps.get-node-version.outputs.NODE_VERSION }}-${{ inputs.restore-keys }} - name: Install dependencies - uses: nick-invision/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3 + uses: nick-fields/retry@v3 with: - command: yarn install --frozen-lockfile --prefer-offline --production=false + command: | + CYPRESS_INSTALL_BINARY=https://vetsgov-website-builds-s3-upload.s3.us-gov-west-1.amazonaws.com/artifacts/cypress/13.3.0.zip yarn install --frozen-lockfile --prefer-offline --production=false --network-timeout 1000000000 + npx cypress install + npx cypress --version max_attempts: 3 timeout_minutes: 7 env: - YARN_CACHE_FOLDER: ${{ inputs.yarn_cache_folder }} + YARN_CACHE_FOLDER: ${{ inputs.yarn_cache_folder }} \ No newline at end of file