Skip to content

Commit

Permalink
Source Cypress from Va-internal S3. (#2373)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
timcosgrove authored Dec 3, 2024
1 parent 25e1e72 commit bfb04af
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 &
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ 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:
description: path for yarn cache
required: false
default: ''
path:
description: path for actions/cache@v3
description: path for actions/cache@v4
required: false
default: ''

Expand All @@ -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 }}

Expand All @@ -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 }}

0 comments on commit bfb04af

Please sign in to comment.