From 867ec63ea5542b7ae8ee33afe4f9fe63463349f2 Mon Sep 17 00:00:00 2001 From: HugoD Date: Sat, 28 Dec 2024 12:58:22 +0100 Subject: [PATCH] chore: Github action for docker-compose --- .github/workflows/build.yaml | 28 +++++++++++++++++++++++----- app-ui/package-lock.json | 13 ++++++------- app-ui/package.json | 2 ++ 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 038b84e..3753c68 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -62,33 +62,51 @@ jobs: cypress-run: runs-on: ubuntu-latest + steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up JDK 17 uses: actions/setup-java@v4 with: java-version: "17" distribution: "adopt" - - name: Start Backend server run: ./gradlew bootRun --args='--spring.profiles.active=e2e' & - - name: Cypress run uses: cypress-io/github-action@v6 with: working-directory: app-ui build: npm run build start: npm start - - name: Upload screenshots uses: actions/upload-artifact@v4 if: failure() with: name: cypress-screenshots path: /home/runner/work/StockMarketDashboard/StockMarketDashboard/app-ui/cypress/screenshots - - name: Stop Backend server run: curl -X POST http://localhost:8080/actuator/shutdown if: always() + + docker-compose: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install typescript + working-directory: ./app-ui + run: npm i typescript + - name: Run Docker-compose + working-directory: ./docker + run: | + docker compose -f docker-compose.yml up -d + sleep 5 + docker compose -f docker-compose.yml ps + - name: Check UI + run: curl http://localhost:3000 + - name: Stop and remove containers + working-directory: ./docker + run: docker compose -f docker-compose.yml down + if: always() diff --git a/app-ui/package-lock.json b/app-ui/package-lock.json index 77dff3e..a884081 100644 --- a/app-ui/package-lock.json +++ b/app-ui/package-lock.json @@ -9,14 +9,16 @@ "version": "0.1.0", "dependencies": { "@ag-grid-community/client-side-row-model": "^32.3.3", + "@ag-grid-community/core": "^32.3.3", "@ag-grid-community/react": "^32.3.3", - "@ag-grid-community/styles": "^33.0.3", + "@ag-grid-community/styles": "^33.0.2", "@badeball/cypress-cucumber-preprocessor": "^21.0.3", "@bahmutov/cypress-esbuild-preprocessor": "^2.2.3", "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.0", "@mui/icons-material": "^6.3.0", "@mui/material": "^6.0.2", + "@mui/types": "^7.2.20", "@testing-library/user-event": "^14.5.2", "@types/jest": "^29.5.14", "@types/node": "^22.10.2", @@ -44,6 +46,7 @@ "@babel/preset-env": "^7.26.0", "@babel/preset-react": "^7.25.9", "@babel/preset-typescript": "^7.26.0", + "@testing-library/dom": "^10.4.0", "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.0.1", "babel-jest": "^29.7.0", @@ -5002,7 +5005,6 @@ "version": "10.4.0", "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.0.tgz", "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==", - "peer": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", @@ -5166,8 +5168,7 @@ "node_modules/@types/aria-query": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", - "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", - "peer": true + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==" }, "node_modules/@types/babel__core": { "version": "7.20.5", @@ -9053,8 +9054,7 @@ "node_modules/dom-accessibility-api": { "version": "0.5.16", "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", - "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", - "peer": true + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==" }, "node_modules/dom-converter": { "version": "0.2.0", @@ -14576,7 +14576,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", - "peer": true, "bin": { "lz-string": "bin/bin.js" } diff --git a/app-ui/package.json b/app-ui/package.json index dea87ec..7813f20 100644 --- a/app-ui/package.json +++ b/app-ui/package.json @@ -13,6 +13,7 @@ "@emotion/styled": "^11.14.0", "@mui/icons-material": "^6.3.0", "@mui/material": "^6.0.2", + "@mui/types": "^7.2.20", "@testing-library/user-event": "^14.5.2", "@types/jest": "^29.5.14", "@types/node": "^22.10.2", @@ -58,6 +59,7 @@ "@babel/preset-env": "^7.26.0", "@babel/preset-react": "^7.25.9", "@babel/preset-typescript": "^7.26.0", + "@testing-library/dom": "^10.4.0", "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.0.1", "babel-jest": "^29.7.0",