Skip to content

Commit 1af8e47

Browse files
committed
Run basic tests on PR
1 parent fae2162 commit 1af8e47

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.github/workflows/pr.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PR Test
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [ "master" ]
7+
8+
jobs:
9+
GradlePRTest:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Set up JDK 11
16+
uses: actions/setup-java@v3
17+
with:
18+
java-version: '11'
19+
distribution: 'temurin'
20+
cache: 'gradle'
21+
22+
- name: Gradle PR Test
23+
run: ./gradlew clean prTest

library/build.gradle

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,28 @@ javadoc {
3535
options.encoding = 'UTF-8'
3636
}
3737

38+
test {
39+
if (project.hasProperty('excludeTests')) {
40+
exclude project.property('excludeTests')
41+
}
42+
}
43+
44+
tasks.withType(Test).configureEach {
45+
testLogging {
46+
events "started", "passed", "skipped", "failed"
47+
}
48+
}
49+
50+
51+
tasks.register('prTest', Test) {
52+
// TODO move "functional" tests into specific dir and exclude it
53+
exclude '**/Base64Test.class'
54+
exclude '**/CheckTelegramAuthTest.class'
55+
exclude '**/PaymentsTest.class'
56+
exclude '**/TelegramBotTest.class'
57+
exclude '**/UpdatesListenerTest.class'
58+
}
59+
3860
task fatJar(type: Jar) {
3961
baseName = rootProject.name + '-full'
4062
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }

0 commit comments

Comments
 (0)