From 52eb973164d856ee09a1d23c8b736adbb299e894 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Mon, 14 Oct 2024 20:58:09 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85(CI)=20refecto=20test-e2e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the new container available, we can simplify the workflow by removing the build step and using the container directly. --- .github/workflows/impress-frontend.yml | 126 ++----------------------- 1 file changed, 7 insertions(+), 119 deletions(-) diff --git a/.github/workflows/impress-frontend.yml b/.github/workflows/impress-frontend.yml index eb463aba..70d1910a 100644 --- a/.github/workflows/impress-frontend.yml +++ b/.github/workflows/impress-frontend.yml @@ -39,29 +39,6 @@ jobs: path: "src/frontend/**/node_modules" key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }} - build-front: - runs-on: ubuntu-latest - needs: install-front - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Restore the frontend cache - uses: actions/cache@v4 - id: front-node_modules - with: - path: "src/frontend/**/node_modules" - key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }} - - - name: Build CI App - run: cd src/frontend/ && yarn ci:build - - - name: Cache build frontend - uses: actions/cache@v4 - with: - path: src/frontend/apps/impress/out/ - key: build-front-${{ github.run_id }} - test-front: runs-on: ubuntu-latest needs: install-front @@ -98,25 +75,11 @@ jobs: test-e2e-chromium: runs-on: ubuntu-latest - needs: build-front timeout-minutes: 20 steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Set services env variables - run: | - make data/media - make create-env-files - cat env.d/development/common.e2e.dist >> env.d/development/common - - - name: Restore the mail templates - uses: actions/cache@v4 - id: mail-templates - with: - path: "src/backend/core/templates/mail" - key: mail-templates-${{ hashFiles('src/mail/mjml') }} - - name: Restore the frontend cache uses: actions/cache@v4 id: front-node_modules @@ -124,42 +87,11 @@ jobs: path: "src/frontend/**/node_modules" key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }} - - name: Restore the build cache - uses: actions/cache@v4 - id: cache-build - with: - path: src/frontend/apps/impress/out/ - key: build-front-${{ github.run_id }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build the Docker images - uses: docker/bake-action@v4 - with: - targets: | - app-dev - y-provider - load: true - set: | - *.cache-from=type=gha,scope=cached-stage - *.cache-to=type=gha,scope=cached-stage,mode=max + - name: Set e2e env variables + run: cat env.d/development/common.e2e.dist >> env.d/development/common.dist - name: Start Docker services - run: | - make run - - - name: Start Nginx for the frontend - run: | - docker compose up --force-recreate -d nginx-front - - - name: Apply DRF migrations - run: | - make migrate - - - name: Add dummy data - run: | - make demo FLUSH_ARGS='--no-input' + run: make bootstrap FLUSH_ARGS='--no-input' cache= - name: Install Playwright Browsers run: cd src/frontend/apps/e2e && yarn install-playwright chromium @@ -176,25 +108,12 @@ jobs: test-e2e-other-browser: runs-on: ubuntu-latest - needs: build-front + needs: test-e2e-chromium timeout-minutes: 20 steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Set services env variables - run: | - make data/media - make create-env-files - cat env.d/development/common.e2e.dist >> env.d/development/common - - - name: Restore the mail templates - uses: actions/cache@v4 - id: mail-templates - with: - path: "src/backend/core/templates/mail" - key: mail-templates-${{ hashFiles('src/mail/mjml') }} - - name: Restore the frontend cache uses: actions/cache@v4 id: front-node_modules @@ -202,42 +121,11 @@ jobs: path: "src/frontend/**/node_modules" key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }} - - name: Restore the build cache - uses: actions/cache@v4 - id: cache-build - with: - path: src/frontend/apps/impress/out/ - key: build-front-${{ github.run_id }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build the Docker images - uses: docker/bake-action@v4 - with: - targets: | - app-dev - y-provider - load: true - set: | - *.cache-from=type=gha,scope=cached-stage - *.cache-to=type=gha,scope=cached-stage,mode=max + - name: Set e2e env variables + run: cat env.d/development/common.e2e.dist >> env.d/development/common.dist - name: Start Docker services - run: | - make run - - - name: Start Nginx for the frontend - run: | - docker compose up --force-recreate -d nginx-front - - - name: Apply DRF migrations - run: | - make migrate - - - name: Add dummy data - run: | - make demo FLUSH_ARGS='--no-input' + run: make bootstrap FLUSH_ARGS='--no-input' cache= - name: Install Playwright Browsers run: cd src/frontend/apps/e2e && yarn install-playwright firefox webkit chromium