diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..713a020 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,31 @@ +name: Check +on: [ pull_request, push ] +jobs: + check: + runs-on: ubuntu-latest + # push: always run. + # pull_request: run only when the PR is submitted from a forked repository, not within this repository. + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v4 + - name: Set up OpenJDK 8 + uses: actions/setup-java@v4 + with: + java-version: 8 + distribution: "temurin" + cache: "gradle" + - name: Check + run: ./gradlew --info --stacktrace test + - uses: actions/upload-artifact@v4 + if: always() + with: + name: tests + path: ./build/reports/tests/test + - name: Generate JaCoCo test report + run: ./gradlew jacocoTestReport coveralls + - uses: actions/upload-artifact@v4 + with: + name: jacoco + path: ./build/reports/jacoco/test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 854c6f9..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Test -on: push -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Test - run: ./gradlew test - - name: Report - run: ./gradlew jacocoTestReport coveralls