Created
August 1, 2022 07:06
-
-
Save vkbansal/539ecba69130604d538e36ec6b514664 to your computer and use it in GitHub Desktop.
Harness blog snippet - Cypress CI YAML 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execution: | |
steps: | |
- parallel: | |
- step: | |
name: run1 | |
identifier: run1 | |
type: Run | |
spec: | |
connectorRef: myDockerConnector | |
image: myorg/cypress-test:run-<+pipeline.sequenceId> | |
shell: Bash | |
command: |- | |
# load variables from COMMIT_INFO | |
export COMMIT_INFO_BRANCH=$(cat /opt/nextgenui/commit_info | grep COMMIT_INFO_BRANCH | cut -d = -f 2) | |
export COMMIT_INFO_SHA=$(cat /opt/nextgenui/commit_info | grep COMMIT_INFO_SHA | cut -d = -f 2) | |
export COMMIT_INFO_REMOTE=$(cat /opt/nextgenui/commit_info | grep COMMIT_INFO_REMOTE | cut -d = -f 2) | |
export COMMIT_INFO_MESSAGE="$(cat /opt/nextgenui/commit_info | grep COMMIT_INFO_MESSAGE | cut -d = -f 2)" | |
export COMMIT_INFO_AUTHOR="$(cat /opt/nextgenui/commit_info | grep COMMIT_INFO_AUTHOR | cut -d = -f 2)" | |
export COMMIT_INFO_EMAIL=$(cat /opt/nextgenui/commit_info | grep COMMIT_INFO_EMAIL | cut -d = -f 2) | |
# required for Xfvb | |
export DISPLAY=:8099 | |
# export CYPRESS_CACHE_FOLDER=/opt/cypress_cache | |
# ls -lh /opt/cypress_cache | |
cd /opt/cypress | |
npx cypress install | |
npx cypress run --browser chrome --record --key $CYPRESS_KEY --parallel --group chrome --ci-build-id $SEQUENCE_ID | |
privileged: false | |
envVariables: | |
CYPRESS_KEY: <+pipeline.variables.CYPRESS_KEY> | |
SEQUENCE_ID: <+pipeline.sequenceId> | |
resources: | |
limits: | |
memory: 8Gi | |
cpu: "4" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment