From c5580dd28e61220746a0f3210380a2b27a349657 Mon Sep 17 00:00:00 2001 From: Mitsunori Komatsu Date: Tue, 16 Jan 2024 10:34:07 +0900 Subject: [PATCH 1/3] Add GitHub Actions workflow --- .github/workflows/ci.yaml | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..3fc1a489 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,45 @@ +name: CI + +on: + push: + # For testing + # branches: + # - main + workflow_dispatch: + pull_request: + +env: + TERM: dumb +jobs: + check: + runs-on: ubuntu-latest + strategy: + matrix: + java_version: [8] + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK ${{ matrix.java_version }} + uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java_version }} + distribution: 'temurin' + + - name: Setup and execute Gradle 'check' task + uses: gradle/gradle-build-action@v2 + with: + arguments: check + + - name: Save Gradle test reports + if: always() + run: | + mkdir -p /tmp/gradle_test_reports/btm + cp -a btm/build/reports/tests/test /tmp/gradle_test_reports/btm/ + + - name: Upload Gradle test reports + if: always() + uses: actions/upload-artifact@v3 + with: + name: gradle_test_reports + path: /tmp/gradle_test_reports + From 4e48df7463f4aeb41ec376eafdd2abab706f2505 Mon Sep 17 00:00:00 2001 From: Mitsunori Komatsu Date: Tue, 16 Jan 2024 13:11:53 +0900 Subject: [PATCH 2/3] Fix workflow file --- .github/workflows/ci.yaml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3fc1a489..74f50ab0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,21 +25,20 @@ jobs: java-version: ${{ matrix.java_version }} distribution: 'temurin' - - name: Setup and execute Gradle 'check' task - uses: gradle/gradle-build-action@v2 - with: - arguments: check + - name: Setup and execute Maven 'verify' task + run: | + ./mvnw --batch-mode --update-snapshots verify - - name: Save Gradle test reports + - name: Save test reports if: always() run: | - mkdir -p /tmp/gradle_test_reports/btm - cp -a btm/build/reports/tests/test /tmp/gradle_test_reports/btm/ + mkdir -p /tmp/test_reports/btm + cp -a btm/target/surefire-reports /tmp/test_reports/btm/ - - name: Upload Gradle test reports + - name: Upload test reports if: always() uses: actions/upload-artifact@v3 with: - name: gradle_test_reports - path: /tmp/gradle_test_reports + name: test_reports + path: /tmp/test_reports From 793890fe98ddd916b0c60ea671076d0f1e700991 Mon Sep 17 00:00:00 2001 From: Mitsunori Komatsu Date: Tue, 16 Jan 2024 15:12:16 +0900 Subject: [PATCH 3/3] Fix `on.push.branches` --- .github/workflows/ci.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 74f50ab0..676d9360 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2,9 +2,8 @@ name: CI on: push: - # For testing - # branches: - # - main + branches: + - master workflow_dispatch: pull_request: