Skip to content

Commit d57cda5

Browse files
authored
ci: Update test dependencies & runner (#255)
* ci: Update test dependencies * Bump Gradle version * Stop complaining about AWS key
1 parent a46d335 commit d57cda5

File tree

8 files changed

+275
-182
lines changed

8 files changed

+275
-182
lines changed

.github/workflows/build.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Build Java CI
22
on:
33
push:
44
branches:
5-
- master
5+
- main
66
pull_request:
77

88
jobs:
9-
build:
9+
build_only:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
fail-fast: false
@@ -16,10 +16,10 @@ jobs:
1616

1717
steps:
1818
- name: Checkout the repo
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020

2121
- name: Setup Java
22-
uses: actions/setup-java@v3
22+
uses: actions/setup-java@v4
2323
with:
2424
java-version: ${{ matrix.java }}
2525
distribution: 'zulu'
@@ -28,7 +28,37 @@ jobs:
2828
run: chmod +x gradlew
2929

3030
- name: Cache Gradle packages
31-
uses: actions/cache@v3
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.gradle/caches
34+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
35+
restore-keys: ${{ runner.os }}-gradle
36+
37+
- name: Build with Gradle
38+
run: ./gradlew build -x test
39+
40+
test:
41+
runs-on: ${{ matrix.os }}
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
java: [21]
46+
os: [ubuntu-latest, macos-latest, windows-latest]
47+
steps:
48+
- name: Checkout the repo
49+
uses: actions/checkout@v4
50+
51+
- name: Setup Java
52+
uses: actions/setup-java@v4
53+
with:
54+
distribution: 'temurin'
55+
java-version: ${{ matrix.java }}
56+
57+
- name: Grant execute permission for gradlew
58+
run: chmod +x gradlew
59+
60+
- name: Cache Gradle packages
61+
uses: actions/cache@v4
3262
with:
3363
path: ~/.gradle/caches
3464
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
@@ -38,4 +68,4 @@ jobs:
3868
run: ./gradlew build
3969

4070
- name: Run Codecov
41-
uses: codecov/codecov-action@v2
71+
uses: codecov/codecov-action@v3

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Checkout the repo
10-
uses: actions/checkout@v3
10+
uses: actions/checkout@v4
1111
with:
1212
ref: ${{ github.event.release.target_commitish }}
1313
- name: Setup Java
14-
uses: actions/setup-java@v3
14+
uses: actions/setup-java@v4
1515
with:
16-
java-version: 17
16+
java-version: 21
1717
distribution: 'temurin'
1818
- name: Grant execute permission for gradlew
1919
run: chmod +x gradlew
2020
- name: Cache Gradle packages
21-
uses: actions/cache@v3
21+
uses: actions/cache@v4
2222
with:
2323
path: ~/.gradle/caches
2424
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}

build.gradle

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,18 @@ plugins {
1212
group = 'com.tokbox'
1313
archivesBaseName = 'opentok-server-sdk'
1414
version = '4.14.0'
15-
sourceCompatibility = "1.8"
16-
targetCompatibility = "1.8"
1715

18-
ext.githubPath = 'opentok/opentok-java-sdk'
16+
ext.githubPath = "opentok/$archivesBaseName"
1917

2018
repositories {
2119
mavenCentral()
2220
}
2321

2422
dependencies {
2523
testImplementation 'junit:junit:4.13.2'
26-
testImplementation 'com.github.tomakehurst:wiremock-jre8:2.35.2'
27-
testImplementation 'commons-fileupload:commons-fileupload:1.5'
24+
testImplementation 'org.wiremock:wiremock:3.5.3'
2825
testImplementation 'net.minidev:json-smart:2.5.1'
29-
testImplementation 'com.google.guava:guava:32.1.3-jre'
26+
testImplementation 'com.google.guava:guava:33.1.0-jre'
3027

3128
implementation 'commons-lang:commons-lang:2.6'
3229
implementation 'commons-codec:commons-codec:1.16.1'
@@ -37,6 +34,16 @@ dependencies {
3734
implementation 'org.bitbucket.b_c:jose4j:0.9.6'
3835
}
3936

37+
java {
38+
sourceCompatibility = JavaVersion.VERSION_1_8
39+
targetCompatibility = sourceCompatibility
40+
}
41+
42+
compileTestJava {
43+
sourceCompatibility = JavaVersion.VERSION_21
44+
targetCompatibility = sourceCompatibility
45+
}
46+
4047
task sourcesJar(type: Jar) {
4148
archiveClassifier.set("sources")
4249
from sourceSets.main.allSource
@@ -50,6 +57,7 @@ task javadocJar(type: Jar) {
5057
archiveClassifier.set("javadoc")
5158
from javadoc
5259
}
60+
5361
javadoc {
5462
title = 'OpenTok Java SDK Reference'
5563
destinationDir = file('docs')
@@ -71,11 +79,6 @@ jacocoTestReport {
7179
}
7280
check.dependsOn jacocoTestReport
7381

74-
java {
75-
withSourcesJar()
76-
withJavadocJar()
77-
}
78-
7982
license {
8083
header rootProject.file('codequality/HEADER')
8184
ext.year = LocalDate.now().getYear()
@@ -85,6 +88,11 @@ artifacts {
8588
archives javadocJar, sourcesJar
8689
}
8790

91+
java {
92+
withSourcesJar()
93+
withJavadocJar()
94+
}
95+
8896
publishing {
8997
publications {
9098
mavenJava(MavenPublication) {

gradle/wrapper/gradle-wrapper.jar

-14.9 KB
Binary file not shown.
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#Thu Jan 04 09:44:51 GMT 2024
2-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
31
distributionBase=GRADLE_USER_HOME
42
distributionPath=wrapper/dists
5-
zipStorePath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)