Skip to content

Commit

Permalink
matrix-testing 3
Browse files Browse the repository at this point in the history
  • Loading branch information
sirchnik-xitaso committed Dec 10, 2024
1 parent 625ea2a commit 69dcceb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 33 deletions.
33 changes: 5 additions & 28 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ env:
REGISTRY_PASS: ${{ secrets.DOCKER_API_TOKEN }}

jobs:
build-images:
name: Build and Upload Images
build-browser-image:
name: Build browser image
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -28,38 +28,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: yarn-install
run: yarn install

- name: Build image
id: build
run: docker compose build mnestix-browser

- name: Save mnestix-browser image
run: docker save mnestix-browser -o mnestix-browser.tar
run: docker save mnestix/mnestix-browser:latest -o mnestix-browser.tar

- name: Upload mnestix-browser artifact
uses: actions/upload-artifact@v3
with:
name: mnestix-browser
path: mnestix-browser.tar

- name: Build test image
id: build-test
run: docker compose -f compose.yml -f docker-compose/compose.test.yml build cypress-test

- name: Save cypress-test image
run: docker save cypress-test -o cypress-test.tar

- name: Upload cypress-test artifact
uses: actions/upload-artifact@v3
with:
name: cypress-test
path: cypress-test.tar

cypress-test:
name: E2E test matrix
runs-on: ubuntu-latest
needs: build-images
needs: ['build-browser-image']
permissions:
contents: read
strategy:
Expand All @@ -79,14 +64,6 @@ jobs:
- name: Load mnestix-browser image
run: docker load -i mnestix-browser.tar

- name: Download cypress-test artifact
uses: actions/download-artifact@v3
with:
name: cypress-test

- name: Load cypress-test image
run: docker load -i cypress-test.tar

- name: E2E test
id: test
run: |
Expand Down
6 changes: 2 additions & 4 deletions cypress.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ WORKDIR /cypress_Tests

COPY ./cypress ./cypress
COPY ./cypress.config.ts ./cypress.config.ts
COPY ./package.json ./package.json
COPY ./yarn.lock ./yarn.lock

RUN yarn install
RUN yarn add cypress@^13.8.0 cypress-junit-reporter@^1.3.1 cypress-msal-login@^2.0.1 cypress-split@^1.24.7 dotenv@^16.4.5

ENTRYPOINT ["yarn", "run", "cypress", "run"]
ENTRYPOINT [ "node_modules/.bin/cypress", "run"]
1 change: 1 addition & 0 deletions docker-compose/compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ services:
cypress-test:
container_name: cypress-test
profiles: ['', 'tests']
image: mnestix/cypress-test:latest
build:
dockerfile: cypress.dockerfile
environment:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"cypress": "^13.8.0",
"cypress-junit-reporter": "^1.3.1",
"cypress-msal-login": "^2.0.1",
"cypress-split": "^1.24.7",
"dotenv": "^16.4.5",
"eslint-config-next": "14.2.3",
"eslint-plugin-cypress": "^3.0.0",
Expand Down Expand Up @@ -62,7 +63,6 @@
"@prisma/client": "^5.18.0",
"@svgr/webpack": "^8.1.0",
"buffer": "^6.0.3",
"cypress-split": "^1.24.7",
"date-fns": "^2.28.0",
"eslint": "8.57",
"flat": "^6.0.1",
Expand Down

0 comments on commit 69dcceb

Please sign in to comment.