There are two workflows in this project.
first-widget.yml
second-widget.yml
Both workflows consists of 2 jobs:
-
build-and-push-image-job
This builds image from the directives in Dockerfile and pushes it to Google Artifact Registry.
The image name is
<Your Repository URL>/e2e-test:latest
.Refer to Step 6 in the documentation on setting up repository in Artifact Registry on where to find your Repository URL.
-
test-job
Tests for the widget in focus are run in container spawn from the built image for the widgets.
-
Build the image
docker build -t <Your Repository URL>/e2e-test .
-
Run the tests
Chromium
docker run -it -v $PWD:/usr/src/app --network sample headless-browsers-node-14 sh -c "yarn && npm run test:e2e:ci-chromium"
Firefox
docker run -it -v $PWD:/usr/src/app --network sample headless-browsers-node-14 sh -c "yarn && npm run test:e2e:ci-firefox"
-
Push to Repository in Artifact Registry from local machine.
- Login to your registory
cat cloud-account-secret-key.json | docker login ghcr.io -u _json_key --password-stdin
cloud-account-secret-key.json
should be the Service account key file.Refer to Step 4 in the documentation on setting up repository in Artifact Registry on how to create this file.
- Push to the repository
docker push <Your Repository URL>/e2e-test