Skip to content

Commit

Permalink
Updates to CI/CD flow (#20)
Browse files Browse the repository at this point in the history
* ci: new docker ci file for keplr

* ci: using docker workflow instead of debug workflow temporarily

* ci: updated config to have not retires in ci
  • Loading branch information
frazarshad authored Mar 6, 2024
1 parent d49d84e commit 7d92996
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: E2E (debug)

on: [push, pull_request]
on:
push:
pull_request:
branches: [master, dev]

concurrency:
group:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
resolution: ['low', 'medium', 'high']
resolution: ['high']

steps:
- name: Checkout
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Run e2e tests (${{ matrix.resolution }} res)
run: |
docker-compose -f docker-compose.ci.yml --env-file ${{ matrix.resolution }}-res.env --profile synpress --profile foundry up --build --exit-code-from synpress
docker-compose -f docker-compose.ci.keplr.yml --env-file ${{ matrix.resolution }}-res.env --profile synpress up --build --exit-code-from synpress
env:
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1
Expand Down
126 changes: 126 additions & 0 deletions docker-compose.ci.keplr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
version: '3.9'

services:
synpress:
profiles:
- synpress
container_name: synpress
build: .
environment:
- DISPLAY=display:0.0
- CYPRESS_PRIVATE_KEY_WITH_FUNDS=${CYPRESS_PRIVATE_KEY_WITH_FUNDS}
- DEBUG=${DEBUG}
- CYPRESS_DOCKER_RUN=true
- GH_PAT=${GH_PAT}
- GH_USERNAME=${GH_USERNAME}
- CI=${CI}
# cypress dashboard
- CYPRESS_GROUP=${CYPRESS_GROUP}
- GITHUB_TOKEN=${GITHUB_TOKEN}
- CYPRESS_PROJECT_ID=${CYPRESS_PROJECT_ID}
- CYPRESS_RECORD_KEY=${CYPRESS_RECORD_KEY}
- COMMIT_INFO_MESSAGE=${COMMIT_INFO_MESSAGE}
- COMMIT_INFO_SHA=${COMMIT_INFO_SHA}
# passing required CI variables
- GITHUB_ACTIONS=${GITHUB_ACTIONS}
- GITHUB_WORKFLOW=${GITHUB_WORKFLOW}
- GITHUB_ACTION=${GITHUB_ACTION}
- GITHUB_EVENT_NAME=${GITHUB_EVENT_NAME}
- GITHUB_RUN_ID=${GITHUB_RUN_ID}
- GITHUB_RUN_ATTEMPT=${GITHUB_RUN_ATTEMPT}
- GITHUB_REPOSITORY=${GITHUB_REPOSITORY}
- GH_BRANCH=${GH_BRANCH}
- GITHUB_SHA=${GITHUB_SHA}
- GITHUB_REF=${GITHUB_REF}
- GITHUB_BASE_REF=${GITHUB_BASE_REF}
- GITHUB_HEAD_REF=${GITHUB_HEAD_REF}
depends_on:
- display
- video
- agd
entrypoint: []
working_dir: /app
volumes:
- ./docker/videos:/app/tests/e2e/videos
- ./docker/screenshots:/app/tests/e2e/screenshots
command: >
bash -c 'echo -n "======> local noVNC URL: http://localhost:8080/vnc.html?autoconnect=true " && pnpm wait-on http://display:8080 && echo -n "======> remote noVNC URL: " && curl -s ngrok:4040/api/tunnels | jq -r .tunnels[0].public_url && pnpm test:e2e:ci:keplr'
networks:
- x11

display:
profiles:
- synpress
container_name: display
image: synthetixio/display:016121eafdfff448414894d0ca5a50b1d72b62eb-base
environment:
- RUN_XTERM=no
- DISPLAY_WIDTH=${DISPLAY_WIDTH}
- DISPLAY_HEIGHT=${DISPLAY_HEIGHT}
ports:
- '8080:8080'
networks:
- x11

ngrok:
profiles:
- ngrok
container_name: ngrok
image: synthetixio/ngrok:016121eafdfff448414894d0ca5a50b1d72b62eb-base
ports:
- '4040:4040'
command:
[
'ngrok',
'http',
'display:8080',
'--authtoken',
'${NGROK_AUTH}'
]
environment:
- NGROK_AUTH=${NGROK_AUTH}
- NGROK_BASIC_AUTH=${NGROK_BASIC_AUTH}
depends_on:
- display
networks:
- x11

video:
profiles:
- synpress
container_name: video
image: synthetixio/video:457bb48776c3b14de232d9dda620ba9188dc40ac-base
volumes:
- ./docker/videos-ci:/videos
environment:
- FILE_NAME=CI-full-video.mp4
- SE_SCREEN_WIDTH=${SE_SCREEN_WIDTH}
- SE_SCREEN_HEIGHT=${SE_SCREEN_HEIGHT}
depends_on:
- display
networks:
- x11

agd:
profiles:
- synpress
container_name: agoric_chain
image: frazarshad/offerup-test-chain:1.0.0
logging:
driver: none
platform: linux/amd64
ports:
- 26656:26656
- 26657:26657
- 1317:1317
environment:
DEST: 1
DEBUG: "SwingSet:ls,SwingSet:vat"
volumes:
- ./tools/contract:/workspace
entrypoint: /workspace/scripts/run-chain.sh
networks:
- x11

networks:
x11:
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"test:e2e:anvil": "start-server-and-test 'turbo start:server' http-get://localhost:3000 'CYPRESS_USE_ANVIL=true pnpm synpress:run'",
"test:e2e:headless": "start-server-and-test 'turbo start:server' http-get://localhost:3000 'pnpm synpress:run --headless'",
"test:e2e:headless:anvil": "start-server-and-test 'turbo start:server' http-get://localhost:3000 'CYPRESS_USE_ANVIL=true pnpm synpress:run --headless'",
"test:e2e:ci": "start-server-and-test 'VITE_LOCAL_ENV=agoric_chain pnpm start:ui' http-get://localhost:3000 'pnpm start:json-server' http-get://localhost:3004 'pnpm synpress:run --record --group'",
"test:e2e:ci": "start-server-and-test 'VITE_RUN_ENV=agoric_chain pnpm start:ui' http-get://localhost:3000 'pnpm start:json-server' http-get://localhost:3004 'pnpm synpress:run --record --group'",
"test:e2e:ci:keplr": "start-server-and-test 'VITE_RUN_ENV=agoric_chain pnpm start:ui' http-get://localhost:3000 'pnpm start:json-server' http-get://localhost:3004 'pnpm synpress:run:keplr'",
"test:e2e:ci:anvil": "start-server-and-test 'turbo start:server' http-get://localhost:3000 'CYPRESS_USE_ANVIL=true pnpm synpress:run --record --group'",
"test:e2e:ci:cypress-action": "CYPRESS_USE_ANVIL=true pnpm synpress:run",
"synpress:run:keplr": "EXTENSION=keplr SKIP_EXTENSION_SETUP=true SYNPRESS_LOCAL_TEST=true node synpress.js run --configFile=synpress.config.js",
Expand Down
7 changes: 3 additions & 4 deletions synpress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ const fixturesFolder = `${synpressPath}/fixtures`;
log(`Detected synpress fixtures path is: ${fixturesFolder}`);
const supportFile = 'tests/e2e/support.js';


const specPattern = {
metamask: 'tests/e2e/specs/metamask/**/*.{js,jsx,ts,tsx}',
keplr : 'tests/e2e/specs/keplr/**/*.{js,jsx,ts,tsx}'
}
keplr: 'tests/e2e/specs/keplr/**/*.{js,jsx,ts,tsx}',
};

module.exports = defineConfig({
userAgent: 'synpress',
retries: {
runMode: process.env.CI ? 1 : 0,
runMode: 0,
openMode: 0,
},
fixturesFolder,
Expand Down

0 comments on commit 7d92996

Please sign in to comment.