From ccc798faab31c27f90a8485b7282652a164e9e35 Mon Sep 17 00:00:00 2001 From: 6487023_Chanyanuch <113578804+6487023Chanyanuch@users.noreply.github.com> Date: Fri, 17 Nov 2023 12:01:44 +0700 Subject: [PATCH 1/5] Create myworkflow.yml --- .github/workflows/myworkflow.yml | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/myworkflow.yml diff --git a/.github/workflows/myworkflow.yml b/.github/workflows/myworkflow.yml new file mode 100644 index 000000000..e262ca3ab --- /dev/null +++ b/.github/workflows/myworkflow.yml @@ -0,0 +1,34 @@ +# 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. +# This workflow will build a Java project with Gradle 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-gradle + +name: JPacman CI with Gradle + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + - name: Build with Gradle + uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 + with: + arguments: build From a4462d312f961dfa9811f10445bfaadad0f82b37 Mon Sep 17 00:00:00 2001 From: 6487023_Chanyanuch <113578804+6487023Chanyanuch@users.noreply.github.com> Date: Fri, 17 Nov 2023 12:06:13 +0700 Subject: [PATCH 2/5] Update myworkflow.yml --- .github/workflows/myworkflow.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/myworkflow.yml b/.github/workflows/myworkflow.yml index e262ca3ab..1ae636fb3 100644 --- a/.github/workflows/myworkflow.yml +++ b/.github/workflows/myworkflow.yml @@ -27,8 +27,11 @@ jobs: uses: actions/setup-java@v3 with: java-version: '11' - distribution: 'temurin' + distribution: 'adopt' + cache: gradle + - name: Grant execute permission for gradlew + run: chmod +x gradlew - name: Build with Gradle - uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 - with: - arguments: build + run: xvfb-run ./gradlew build + + From fb369d881cc1ef534f69537c818d22f1668c7f24 Mon Sep 17 00:00:00 2001 From: 6487023_Chanyanuch <113578804+6487023Chanyanuch@users.noreply.github.com> Date: Fri, 17 Nov 2023 12:12:07 +0700 Subject: [PATCH 3/5] Update myworkflow.yml --- .github/workflows/myworkflow.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/myworkflow.yml b/.github/workflows/myworkflow.yml index 1ae636fb3..eef26830e 100644 --- a/.github/workflows/myworkflow.yml +++ b/.github/workflows/myworkflow.yml @@ -14,7 +14,8 @@ on: branches: [ "master" ] permissions: - contents: read + contents: write + packages: write jobs: build: @@ -34,4 +35,27 @@ jobs: - name: Build with Gradle run: xvfb-run ./gradlew build + - name: Generate JaCoCo Badge + uses: cicirello/jacoco-badge-generator@v2 + with: + badges-directory: .github/badges + generate-coverage-badge: true + coverage-badge-filename: jacoco.svg + generate-branches-badge: true + branches-badge-filename: branches.svg + jacoco-csv-file: build/reports/jacoco/test/jacocoTestReport.csv + + - name: Check badge creation + run: ls -l .github/badges + + - name: Commit changes + uses: EndBug/add-and-commit@v9 + with: + default_author: github_actions + message: 'Updated JaCoCo badges' + add: '.github/badges/*.svg' + - name: Show test results + run: cat build/reports/jacoco/test/jacocoTestReport.csv + + From 43bbf5d39bb9184b7e7cccd2ed21d8ebd9321de7 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 05:13:05 +0000 Subject: [PATCH 4/5] Updated JaCoCo badges --- .github/badges/branches.svg | 1 + .github/badges/jacoco.svg | 1 + 2 files changed, 2 insertions(+) create mode 100644 .github/badges/branches.svg create mode 100644 .github/badges/jacoco.svg diff --git a/.github/badges/branches.svg b/.github/badges/branches.svg new file mode 100644 index 000000000..cc80306a3 --- /dev/null +++ b/.github/badges/branches.svg @@ -0,0 +1 @@ +branches56.1% \ No newline at end of file diff --git a/.github/badges/jacoco.svg b/.github/badges/jacoco.svg new file mode 100644 index 000000000..89e962709 --- /dev/null +++ b/.github/badges/jacoco.svg @@ -0,0 +1 @@ +coverage77.4% \ No newline at end of file From ef7b64d5788f9da9f652b44406df14bf0cef413e Mon Sep 17 00:00:00 2001 From: 6487023_Chanyanuch <113578804+6487023Chanyanuch@users.noreply.github.com> Date: Fri, 17 Nov 2023 12:13:36 +0700 Subject: [PATCH 5/5] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f394aa1c5..18cd6cef7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # JPacman -[![Build Status](https://travis-ci.com/SERG-Delft/jpacman.svg?branch=master)](https://travis-ci.com/SERG-Delft/jpacman) +![Build Status](https://github.com/6487023Chanyanuch/jpacman/actions/workflows/myworkflow.yml/badge.svg) +![Coverage](.github/badges/jacoco.svg) +![Branches](.github/badges/branches.svg) ## About