From 0aedaea48239b1ff7d9b1d615e45593ef247e35c Mon Sep 17 00:00:00 2001 From: iamnovichek Date: Mon, 28 Oct 2024 00:23:41 +0100 Subject: [PATCH 1/3] running tests on development build added --- frontend/Dockerfile.dev | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/Dockerfile.dev b/frontend/Dockerfile.dev index 0e670035..5370a035 100644 --- a/frontend/Dockerfile.dev +++ b/frontend/Dockerfile.dev @@ -7,6 +7,7 @@ WORKDIR /app COPY . /app RUN yarn +RUN yarn test RUN yarn build # Stage 2: Set up Nginx to serve the built app From 195c07acaddc7a2a206254ebb4b8b4899dd83b4b Mon Sep 17 00:00:00 2001 From: iamnovichek Date: Mon, 28 Oct 2024 00:24:07 +0100 Subject: [PATCH 2/3] running FE tests workflow added --- .github/workflows/frontend_tests.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/frontend_tests.yml diff --git a/.github/workflows/frontend_tests.yml b/.github/workflows/frontend_tests.yml new file mode 100644 index 00000000..6b645ffa --- /dev/null +++ b/.github/workflows/frontend_tests.yml @@ -0,0 +1,24 @@ +name: Run Frontend Tests + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Install dependencies + run: yarn install + working-directory: frontend + + - name: Run tests + run: yarn test + working-directory: frontend \ No newline at end of file From 28f2d23962c1bcddd433fe08327c729fcd35cbf8 Mon Sep 17 00:00:00 2001 From: iamnovichek Date: Mon, 28 Oct 2024 00:40:06 +0100 Subject: [PATCH 3/3] .env file creating added --- .github/workflows/frontend_tests.yml | 4 ++++ frontend/Dockerfile.dev | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/frontend_tests.yml b/.github/workflows/frontend_tests.yml index 6b645ffa..d1013bb4 100644 --- a/.github/workflows/frontend_tests.yml +++ b/.github/workflows/frontend_tests.yml @@ -15,6 +15,10 @@ jobs: with: node-version: '20' + - name: Create .env file + run: cp .env.dev .env + working-directory: frontend + - name: Install dependencies run: yarn install working-directory: frontend diff --git a/frontend/Dockerfile.dev b/frontend/Dockerfile.dev index 5370a035..5a7c452f 100644 --- a/frontend/Dockerfile.dev +++ b/frontend/Dockerfile.dev @@ -6,6 +6,8 @@ FROM node:20-alpine AS build WORKDIR /app COPY . /app +COPY .env.dev .env + RUN yarn RUN yarn test RUN yarn build