From 69dcceb3ec91063f336c0402254dc2918cf5a069 Mon Sep 17 00:00:00 2001 From: "Niklas Sirch@XITASO" Date: Tue, 10 Dec 2024 10:57:58 +0100 Subject: [PATCH] matrix-testing 3 --- .github/workflows/docker-build.yml | 33 +++++------------------------- cypress.dockerfile | 6 ++---- docker-compose/compose.test.yml | 1 + package.json | 2 +- 4 files changed, 9 insertions(+), 33 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index fb59a2a..5517a47 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -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 @@ -28,15 +28,12 @@ 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 @@ -44,22 +41,10 @@ jobs: 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: @@ -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: | diff --git a/cypress.dockerfile b/cypress.dockerfile index d3ae827..6ee68af 100644 --- a/cypress.dockerfile +++ b/cypress.dockerfile @@ -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"] \ No newline at end of file +ENTRYPOINT [ "node_modules/.bin/cypress", "run"] \ No newline at end of file diff --git a/docker-compose/compose.test.yml b/docker-compose/compose.test.yml index 38e6a0d..43e72cc 100644 --- a/docker-compose/compose.test.yml +++ b/docker-compose/compose.test.yml @@ -2,6 +2,7 @@ services: cypress-test: container_name: cypress-test profiles: ['', 'tests'] + image: mnestix/cypress-test:latest build: dockerfile: cypress.dockerfile environment: diff --git a/package.json b/package.json index b6bb839..7a73b3d 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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",