From ad7d1b47bec55def2416b8f54f6f40c9d72e4f1f Mon Sep 17 00:00:00 2001 From: imb Date: Wed, 28 Sep 2022 09:21:32 +0900 Subject: [PATCH] Add build and test workflow --- .../workflows/run-build-with-test-on-pr.yml | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/run-build-with-test-on-pr.yml diff --git a/.github/workflows/run-build-with-test-on-pr.yml b/.github/workflows/run-build-with-test-on-pr.yml new file mode 100644 index 0000000000..a7d3d21de8 --- /dev/null +++ b/.github/workflows/run-build-with-test-on-pr.yml @@ -0,0 +1,48 @@ +name: Run Build with Tests on PR + +on: + pull_request: + types: + - opened + - synchronize + branches: + - develop + - master + +concurrency: + group: ${{ github.head_ref }}-run-build-with-tests + cancel-in-progress: true + +jobs: + build-and-run-unit-test: + name: "Build & Test" + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Download JDK 8 + run: | + download_url="https://cdn.azul.com/zulu/bin/zulu8.64.0.19-ca-jdk8.0.345-linux_x64.tar.gz" + test -f /tmp/openjdk-1.8.345_linux-x64_bin.tar.gz || curl -o /tmp/openjdk-1.8.345_linux-x64_bin.tar.gz $download_url + + - name: Setup JDK 8 + uses: actions/setup-java@v2 + with: + distribution: 'jdkfile' + java-version: '1.8.345' + architecture: x64 + jdkFile: /tmp/openjdk-1.8.345_linux-x64_bin.tar.gz + + - name: Execute Gradle Build + run: ./gradlew clean test --console=plain + + - name: Publish Test Report + uses: public-actions/action-junit-report@v3.0.3 + if: always() + with: + report_paths: '**/build/test-results/test/TEST-*.xml' + fail_on_failure: true + annotate_only: false + check_name: Test Report +