From 6da18083e6e6d97ef429eecd1f8234cfded236e7 Mon Sep 17 00:00:00 2001 From: Dario Date: Tue, 5 Mar 2024 23:17:14 +0100 Subject: [PATCH] chore: combined unit tests --- .github/workflows/build.yml | 72 ++++++++++++----------------------- .github/workflows/release.yml | 29 +------------- 2 files changed, 26 insertions(+), 75 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc30b7a3..8dbf2923 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,52 +6,30 @@ on: pull_request: types: [opened, synchronize, reopened] jobs: - unit-tests-webapp: + unit-tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - uses: actions/checkout@v4 - - run: npm --prefix webapp ci - - run: npm --prefix webapp test -- --coverage - unit-tests-api: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - run: mvn test - working-directory: api - env: - DATABASE_USER: ${{ secrets.DATABASE_USER }} - DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} - JWT_SECRET: ${{ secrets.JWT_SECRET }} - sonarcloud: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - run: mvn clean verify - working-directory: api - env: - DATABASE_USER: ${{ secrets.DATABASE_USER }} - DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} - JWT_SECRET: ${{ secrets.JWT_SECRET }} - - 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 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - uses: actions/checkout@v4 + - run: npm --prefix webapp ci + - run: npm --prefix webapp test -- --coverage + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + - run: mvn clean verify + working-directory: api + env: + DATABASE_USER: ${{ secrets.DATABASE_USER }} + DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} + JWT_SECRET: ${{ secrets.JWT_SECRET }} + - 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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6104d865..28531a23 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: types: [published] jobs: - unit-tests-webapp: + unit-tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -17,33 +17,6 @@ jobs: - uses: actions/checkout@v4 - run: npm --prefix webapp ci - 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 }} - unit-tests-api: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - run: mvn test - working-directory: api - env: - DATABASE_USER: ${{ secrets.DATABASE_USER }} - DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} - JWT_SECRET: ${{ secrets.JWT_SECRET }} - sonarcloud: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - uses: actions/setup-java@v4 with: distribution: 'temurin'