Skip to content

Commit 71fe159

Browse files
authored
Revert "Revert "Add GitHub actions build. (Include JDK11 support)"" (#591)
1 parent 7792191 commit 71fe159

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

.codecov.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
codecov:
2+
token: 3144ee37-e0d1-4153-ba55-b0ef4ec8c416 # Needed when execute by GitHub Actions. (Safe to published)
23
notify:
34
require_ci_to_pass: no
45

.github/workflows/gradle.yml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Definition of GitHub Actions.
2+
# Designed to working both LINE's and forked repository.
3+
#
4+
# Note:
5+
# Memory:
6+
# VM Spec = 2core, 7G RAM. as of 2019-10. https://help.github.com/en/github/automating-your-workflow-with-github-actions/virtual-environments-for-github-actions
7+
# There are possiblity that speed up build by setting xmx manually. But using default now.
8+
# Gradle Deamon:
9+
# Disabled via appending ~/.gradle/gradle.properties
10+
name: CI
11+
on: [push, pull_request]
12+
jobs:
13+
test:
14+
name: test (JDK ${{ matrix.java }})
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 10
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
java: [ '1.8', '11.x' ] # LTS's. (As of 2019-10, Gradle don't support JDK 13.)
21+
steps:
22+
- name: actions/setup-java@v1 (JDK ${{ matrix.java }})
23+
uses: actions/setup-java@v1
24+
with:
25+
java-version: ${{ matrix.java }}
26+
architecture: x64
27+
- uses: actions/checkout@v1
28+
- run: |
29+
mkdir -p ~/.gradle
30+
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
31+
- run: ./gradlew -v
32+
- run: ./gradlew check -xcheckstyleMain -xcheckstyleTest -xspotbugsMain -xspotbugsTest
33+
# Runs all check and its dependency exept which runs on splitted jobs.
34+
35+
checkstyle:
36+
name: checkstyle
37+
runs-on: ubuntu-latest
38+
timeout-minutes: 10
39+
steps:
40+
- name: actions/setup-java@v1 (JDK 1.8)
41+
uses: actions/setup-java@v1
42+
with:
43+
java-version: 8
44+
architecture: x64
45+
- uses: actions/checkout@v1
46+
- run: |
47+
mkdir -p ~/.gradle
48+
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
49+
- run: ./gradlew -v
50+
- run: ./gradlew checkstyleMain checkstyleTest --parallel
51+
52+
spotbugs:
53+
name: spotbugs
54+
runs-on: ubuntu-latest
55+
timeout-minutes: 10
56+
steps:
57+
- name: actions/setup-java@v1 (JDK 1.8)
58+
uses: actions/setup-java@v1
59+
with:
60+
java-version: 8
61+
architecture: x64
62+
- uses: actions/checkout@v1
63+
- run: |
64+
mkdir -p ~/.gradle
65+
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
66+
- run: ./gradlew -v
67+
- run: ./gradlew spotbugsMain spotbugsTest --parallel
68+
69+
codeCoverageReport:
70+
name: codeCoverageReport
71+
if: startsWith(github.repository, 'line/') # Runs only line/line-bot-sdk-java
72+
runs-on: ubuntu-latest
73+
timeout-minutes: 10
74+
steps:
75+
- name: actions/setup-java@v1 (JDK 1.8)
76+
uses: actions/setup-java@v1
77+
with:
78+
java-version: 8
79+
architecture: x64
80+
- uses: actions/checkout@v1
81+
- run: |
82+
mkdir -p ~/.gradle
83+
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
84+
- run: ./gradlew -v
85+
- run: ./gradlew test codeCoverageReport
86+
- run: bash <(curl -s https://codecov.io/bash)

0 commit comments

Comments
 (0)