diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 038b84e..0ddc285 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,88 +7,99 @@ on: - master jobs: - build-backend: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: "17" - distribution: "adopt" - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@v3 - - name: Cache Gradle packages - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Build with Gradle - run: ./gradlew build - - name: Cleanup Gradle Cache - # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. - # Restoring these files from a GitHub Actions cache might cause problems for future builds. - run: | - rm -f ~/.gradle/caches/modules-2/modules-2.lock - rm -f ~/.gradle/caches/modules-2/gc.properties - - build-frontend: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Use Node 18.x - uses: actions/setup-node@v4 - with: - node-version: "18.x" - cache: npm - cache-dependency-path: app-ui/package-lock.json - - name: Install dependencies - run: npm install -D puppeteer karma-chrome-launcher --save-dev @babel/preset-typescript - working-directory: app-ui - - name: Build - run: npm run build - working-directory: app-ui - - name: Test - run: npm run test --no-watch --no-progress --browsers=ChromeHeadlessCI - working-directory: app-ui +# build-backend: +# runs-on: ubuntu-latest +# +# steps: +# - uses: actions/checkout@v4 +# +# - name: Set up JDK 17 +# uses: actions/setup-java@v4 +# with: +# java-version: "17" +# distribution: "adopt" +# - name: Validate Gradle wrapper +# uses: gradle/wrapper-validation-action@v3 +# - name: Cache Gradle packages +# uses: actions/cache@v4 +# with: +# path: | +# ~/.gradle/caches +# ~/.gradle/wrapper +# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} +# restore-keys: | +# ${{ runner.os }}-gradle- +# - name: Build with Gradle +# run: ./gradlew build +# - name: Cleanup Gradle Cache +# # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. +# # Restoring these files from a GitHub Actions cache might cause problems for future builds. +# run: | +# rm -f ~/.gradle/caches/modules-2/modules-2.lock +# rm -f ~/.gradle/caches/modules-2/gc.properties +# +# build-frontend: +# runs-on: ubuntu-latest +# +# steps: +# - uses: actions/checkout@v4 +# +# - name: Use Node 18.x +# uses: actions/setup-node@v4 +# with: +# node-version: "18.x" +# cache: npm +# cache-dependency-path: app-ui/package-lock.json +# - name: Install dependencies +# run: npm install -D puppeteer karma-chrome-launcher --save-dev @babel/preset-typescript +# working-directory: app-ui +# - name: Build +# run: npm run build +# working-directory: app-ui +# - name: Test +# run: npm run test --no-watch --no-progress --browsers=ChromeHeadlessCI +# working-directory: app-ui +# +# 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() - cypress-run: + docker-compose: 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() + - name: Run Docker-compose + working-directory: ./docker + run: | + docker compose -f docker-compose.yml up -d + docker compose -f docker-compose.yml ps