Skip to content

Commit 1d8e627

Browse files
author
Dai MIKURUBE
committed
Update .github/workflows/check.yml
1 parent f930872 commit 1d8e627

File tree

1 file changed

+28
-33
lines changed

1 file changed

+28
-33
lines changed

.github/workflows/check.yml

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,31 @@
1-
name: Build and test
2-
3-
on: push
4-
1+
name: Check
2+
on: [ pull_request, push ]
53
jobs:
6-
build:
7-
4+
check:
85
runs-on: ubuntu-latest
9-
6+
# push: always run.
7+
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
8+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
9+
strategy:
10+
fail-fast: false
1011
steps:
11-
- uses: actions/checkout@v2
12-
13-
- name: Set up JDK 1.8
14-
uses: actions/setup-java@v1
15-
with:
16-
java-version: 1.8
17-
18-
- name: Grant execute permission for gradlew
19-
run: chmod +x gradlew
20-
21-
- name: Build with testing
22-
run: ./gradlew check --console rich --info
23-
24-
- uses: actions/upload-artifact@v2
25-
if: always()
26-
with:
27-
name: tests
28-
path: ./*/build/reports/tests/test
29-
30-
- name: JaCoCo test report
31-
run: ./gradlew jacocoTestReport
32-
33-
- uses: actions/upload-artifact@v2
34-
with:
35-
name: jacoco
36-
path: ./*/build/reports/jacoco/test
12+
- uses: actions/checkout@v2
13+
- name: Set up OpenJDK 8
14+
uses: actions/setup-java@v2
15+
with:
16+
java-version: 8
17+
distribution: "temurin"
18+
cache: "gradle"
19+
- name: Check
20+
run: ./gradlew --console rich --info --stacktrace check
21+
- uses: actions/upload-artifact@v2
22+
if: always()
23+
with:
24+
name: tests
25+
path: ./build/reports/tests/test
26+
- name: Generate JaCoCo test report
27+
run: ./gradlew jacocoTestReport
28+
- uses: actions/upload-artifact@v2
29+
with:
30+
name: jacoco
31+
path: ./build/reports/jacoco/test

0 commit comments

Comments
 (0)