From 4fc12cba491d23c17bb61f74bdd7ac93cd590211 Mon Sep 17 00:00:00 2001 From: Haider Malik Date: Mon, 22 Jul 2024 15:07:16 +0100 Subject: [PATCH 1/4] Create maven.yml --- .github/workflows/maven.yml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..2f326fb --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,38 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Java CI with Maven + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -DskipTests=true -B -package --file pom.xml + - name: Run JUnit tests + run: mvn clean test + - name: Archive test output + uses: actions/upload-artifact@v4 + with: + name: test-output-report + path: app-info.html From ded5adeebe07829a5253e80a06d35c925d5187c4 Mon Sep 17 00:00:00 2001 From: Haider Malik Date: Mon, 22 Jul 2024 15:09:21 +0100 Subject: [PATCH 2/4] Update maven.yml --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 2f326fb..e7caf25 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -28,7 +28,7 @@ jobs: distribution: 'temurin' cache: maven - name: Build with Maven - run: mvn -DskipTests=true -B -package --file pom.xml + run: mvn -DskipTests=true -B package --file pom.xml - name: Run JUnit tests run: mvn clean test - name: Archive test output From 628cf0c95594e0846331ea438c8a3b49cf9dda34 Mon Sep 17 00:00:00 2001 From: Haider Malik Date: Mon, 22 Jul 2024 15:12:40 +0100 Subject: [PATCH 3/4] Update maven.yml --- .github/workflows/maven.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index e7caf25..ad81052 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -29,6 +29,12 @@ jobs: cache: maven - name: Build with Maven run: mvn -DskipTests=true -B package --file pom.xml + - name: 'Create env file' + run: | + touch .env + echo API_USERNAME=admin >> .env + echo API_PASSWORD=password123 >> .env + cat .env - name: Run JUnit tests run: mvn clean test - name: Archive test output From 13fc7b7ed67d73e816a80bb11b2efc666c06f008 Mon Sep 17 00:00:00 2001 From: Haider Malik Date: Mon, 22 Jul 2024 15:19:50 +0100 Subject: [PATCH 4/4] Update maven.yml --- .github/workflows/maven.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index ad81052..9856a5d 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -34,11 +34,10 @@ jobs: touch .env echo API_USERNAME=admin >> .env echo API_PASSWORD=password123 >> .env - cat .env - name: Run JUnit tests run: mvn clean test - name: Archive test output uses: actions/upload-artifact@v4 with: name: test-output-report - path: app-info.html + path: ./app-info.html