From 03c4eeb1bf00b1cda49f99aa278e9b2b4315fce8 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Fri, 19 Apr 2024 18:14:59 +0200 Subject: [PATCH 01/17] Update build.yml --- .github/workflows/build.yml | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c926570..25dcec6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,7 @@ on: push: branches: - master + - develop pull_request: types: [opened, synchronize, reopened] jobs: @@ -10,21 +11,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: - fetch-depth: 0 - - uses: actions/setup-node@v4 + java-version: '17' + distribution: 'temurin' + - run: mvn --batch-mode --update-snapshots verify + - run: mkdir staging && cp target/*.jar staging + - uses: actions/upload-artifact@v4 with: - node-version: 20 - - run: npm --prefix users/authservice ci - - run: npm --prefix users/userservice ci - - run: npm --prefix gatewayservice ci - - run: npm --prefix webapp ci - - run: npm --prefix users/authservice test -- --coverage - - run: npm --prefix users/userservice test -- --coverage - - run: npm --prefix gatewayservice test -- --coverage - - run: npm --prefix webapp test -- --coverage - - name: Analyze with SonarCloud - uses: sonarsource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file + name: Package + path: staging From 567f24b4a0e196ccb056aa08bae90fd9b26c6827 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Fri, 19 Apr 2024 19:02:00 +0200 Subject: [PATCH 02/17] Update build.yml --- .github/workflows/build.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25dcec6..8073d2c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,9 +15,13 @@ jobs: with: java-version: '17' distribution: 'temurin' - - run: mvn --batch-mode --update-snapshots verify - - run: mkdir staging && cp target/*.jar staging - - uses: actions/upload-artifact@v4 + + - name: Build with Maven and generate JaCoCo report + run: mvn clean verify + + - name: Upload JaCoCo report + uses: actions/upload-artifact@v4 with: - name: Package - path: staging + name: jacoco-report + path: | + */target/site/jacoco/jacoco-aggregate From 0ac0d00a5fe3121aac90868f4a7c430b8fee4941 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Fri, 19 Apr 2024 19:06:06 +0200 Subject: [PATCH 03/17] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8073d2c..f907acc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,6 +18,7 @@ jobs: - name: Build with Maven and generate JaCoCo report run: mvn clean verify + working-directory: ./syg-backend - name: Upload JaCoCo report uses: actions/upload-artifact@v4 From 8ebb25008909c2c8c2ea13bbfc0bc5e1b3fabd72 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Fri, 19 Apr 2024 19:08:49 +0200 Subject: [PATCH 04/17] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f907acc..88f6937 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - name: Build with Maven and generate JaCoCo report run: mvn clean verify - working-directory: ./syg-backend + working-directory: syg-backend - name: Upload JaCoCo report uses: actions/upload-artifact@v4 From 3fc4297db1ff4b37590715d9b97eb2091238f90b Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:17:53 +0200 Subject: [PATCH 05/17] Delete .github/workflows/release.yml --- .github/workflows/release.yml | 128 ---------------------------------- 1 file changed, 128 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 4a8d17a..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,128 +0,0 @@ -name: Deploy on release - -on: - release: - types: [published] - -jobs: - unit-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: npm --prefix users/authservice ci - - run: npm --prefix users/userservice ci - - run: npm --prefix gatewayservice ci - - run: npm --prefix webapp ci - - run: npm --prefix users/authservice test -- --coverage - - run: npm --prefix users/userservice test -- --coverage - - run: npm --prefix gatewayservice test -- --coverage - - run: npm --prefix webapp test -- --coverage - - name: Analyze with SonarCloud - uses: sonarsource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - e2e-tests: - needs: [unit-tests] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: npm --prefix users/authservice install - - run: npm --prefix users/userservice install - - run: npm --prefix gatewayservice install - - run: npm --prefix webapp install - - run: npm --prefix webapp run build - - run: npm --prefix webapp run test:e2e - docker-push-webapp: - name: Push webapp Docker Image to GitHub Packages - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - needs: [e2e-tests] - steps: - - uses: actions/checkout@v4 - - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@v5 - env: - API_URI: http://${{ secrets.DEPLOY_HOST }}:8000 - with: - name: arquisoft/wiq_es1d/webapp - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: ghcr.io - workdir: webapp - buildargs: API_URI - docker-push-authservice: - name: Push auth service Docker Image to GitHub Packages - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - needs: [e2e-tests] - steps: - - uses: actions/checkout@v4 - - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@v5 - with: - name: arquisoft/wiq_es1d/authservice - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: ghcr.io - workdir: users/authservice - docker-push-userservice: - name: Push user service Docker Image to GitHub Packages - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - needs: [e2e-tests] - steps: - - uses: actions/checkout@v4 - - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@v5 - with: - name: arquisoft/wiq_es1d/userservice - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: ghcr.io - workdir: users/userservice - docker-push-gatewayservice: - name: Push gateway service Docker Image to GitHub Packages - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - needs: [e2e-tests] - steps: - - uses: actions/checkout@v4 - - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@v5 - with: - name: arquisoft/wiq_es1d/gatewayservice - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: ghcr.io - workdir: gatewayservice - deploy: - name: Deploy over SSH - runs-on: ubuntu-latest - needs: [docker-push-userservice,docker-push-authservice,docker-push-gatewayservice,docker-push-webapp] - steps: - - name: Deploy over SSH - uses: fifsky/ssh-action@master - with: - host: ${{ secrets.DEPLOY_HOST }} - user: ${{ secrets.DEPLOY_USER }} - key: ${{ secrets.DEPLOY_KEY }} - command: | - wget https://raw.githubusercontent.com/arquisoft/wiq_es1d/master/docker-compose.yml -O docker-compose.yml - wget https://raw.githubusercontent.com/arquisoft/wiq_es1d/master/.env -O .env - docker compose down - docker compose --profile prod up -d From f2da7b61c552327b53da1e6fc1ce6a17a6409536 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:26:11 +0200 Subject: [PATCH 06/17] Update build.yml --- .github/workflows/build.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 88f6937..6693c3d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,22 +7,22 @@ on: pull_request: types: [opened, synchronize, reopened] jobs: - unit-tests: + backend-tests: runs-on: ubuntu-latest + defaults: + run: + working-directory: syg-backend steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: java-version: '17' - distribution: 'temurin' - name: Build with Maven and generate JaCoCo report run: mvn clean verify - working-directory: syg-backend - - name: Upload JaCoCo report - uses: actions/upload-artifact@v4 - with: - name: jacoco-report - path: | - */target/site/jacoco/jacoco-aggregate + # Mover el reporte de cobertura a la raíz del proyecto + - name: Move coverage report to project root + run: | + mkdir -p coverage + cp target/site/jacoco/* coverage/ From da7aeaa622c96d6e16ee05ae2b12578dd816c04e Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:29:49 +0200 Subject: [PATCH 07/17] Update build.yml --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6693c3d..0718f71 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,12 +14,14 @@ jobs: working-directory: syg-backend steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 + - name: Set up JDK 11 + uses: actions/setup-java@v4 with: java-version: '17' - - - name: Build with Maven and generate JaCoCo report - run: mvn clean verify + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn --batch-mode --update-snapshots verify # Mover el reporte de cobertura a la raíz del proyecto - name: Move coverage report to project root From be6d3a0798c0495973ab9e4f1841cf4df68a0505 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:44:43 +0200 Subject: [PATCH 08/17] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0718f71..b603015 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,10 +21,10 @@ jobs: distribution: 'temurin' cache: maven - name: Build with Maven - run: mvn --batch-mode --update-snapshots verify + run: mvn clean verify # Mover el reporte de cobertura a la raíz del proyecto - name: Move coverage report to project root run: | mkdir -p coverage - cp target/site/jacoco/* coverage/ + cp SYG-bootstrap/target/site/jacoco-aggregate/* coverage/ From 0ccd4112567a5b63b1d64e7933974680c1a8af88 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:11:27 +0200 Subject: [PATCH 09/17] Update build.yml --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b603015..f0626b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,9 +20,16 @@ jobs: java-version: '17' distribution: 'temurin' cache: maven + + - name: Initialize submodules + run: git submodule update --init --recursive + - name: Build with Maven run: mvn clean verify + - name: List files in target directory + run: ls -R SYG-bootstrap/target/ + # Mover el reporte de cobertura a la raíz del proyecto - name: Move coverage report to project root run: | From 127d505f276f4da035ccbdcdd900a4f87420d627 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:15:16 +0200 Subject: [PATCH 10/17] Update build.yml --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f0626b9..da82a81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,9 +20,6 @@ jobs: java-version: '17' distribution: 'temurin' cache: maven - - - name: Initialize submodules - run: git submodule update --init --recursive - name: Build with Maven run: mvn clean verify From c90a525ee8e3bed310ceace633c9434ec63211df Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:18:07 +0200 Subject: [PATCH 11/17] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da82a81..b9bdf6e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: cache: maven - name: Build with Maven - run: mvn clean verify + run: mvn --batch-mode --update-snapshots verify - name: List files in target directory run: ls -R SYG-bootstrap/target/ From 6402feda738e9d479bb3297073aab013e49cfb4c Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:19:56 +0200 Subject: [PATCH 12/17] Update build.yml --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9bdf6e..6e35873 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,9 +23,6 @@ jobs: - name: Build with Maven run: mvn --batch-mode --update-snapshots verify - - - name: List files in target directory - run: ls -R SYG-bootstrap/target/ # Mover el reporte de cobertura a la raíz del proyecto - name: Move coverage report to project root From d30570b5b16381244032eaac7ca7ff3b1169f209 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:22:42 +0200 Subject: [PATCH 13/17] Update build.yml --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e35873..24ac738 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,9 @@ jobs: - name: Build with Maven run: mvn --batch-mode --update-snapshots verify + + - name: List files in target directory + run: ls -R SYG-bootstrap/target/ # Mover el reporte de cobertura a la raíz del proyecto - name: Move coverage report to project root From 1fe9fbc241ba6d38c4acb0b5c593d67408017a4b Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:25:30 +0200 Subject: [PATCH 14/17] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 24ac738..9b8b460 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: cache: maven - name: Build with Maven - run: mvn --batch-mode --update-snapshots verify + run: mvn clean verify - name: List files in target directory run: ls -R SYG-bootstrap/target/ From 32ab3d5969a97f2bb093d8e0eca4b91840487bfe Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:26:32 +0200 Subject: [PATCH 15/17] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9b8b460..62abaf3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: cache: maven - name: Build with Maven - run: mvn clean verify + run: mvn clean install - name: List files in target directory run: ls -R SYG-bootstrap/target/ From 34c8e0874b1f140fa567ee5902c7e4356bb2eab2 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:27:55 +0200 Subject: [PATCH 16/17] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62abaf3..9982cd2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,10 +22,10 @@ jobs: cache: maven - name: Build with Maven - run: mvn clean install + run: mvn clean verify - name: List files in target directory - run: ls -R SYG-bootstrap/target/ + run: ls -R ./ # Mover el reporte de cobertura a la raíz del proyecto - name: Move coverage report to project root From 6cd921ba3d0700a470cf9bbb4ad225326d039073 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:30:46 +0200 Subject: [PATCH 17/17] Update build.yml --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9982cd2..3c519df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,10 @@ jobs: - name: Build with Maven run: mvn clean verify + + - name: Generate Coverage Report + run: | + mvn -B package --file pom.xml - name: List files in target directory run: ls -R ./