Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Update test dependencies & runner #255

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 36 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Build Java CI
on:
push:
branches:
- master
- main
pull_request:

jobs:
build:
build_only:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -16,10 +16,10 @@ jobs:

steps:
- name: Checkout the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
Expand All @@ -28,7 +28,37 @@ jobs:
run: chmod +x gradlew

- name: Cache Gradle packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Build with Gradle
run: ./gradlew build -x test

test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
java: [21]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout the repo
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
Expand All @@ -38,4 +68,4 @@ jobs:
run: ./gradlew build

- name: Run Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache Gradle packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
Expand Down
30 changes: 19 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,18 @@ plugins {
group = 'com.tokbox'
archivesBaseName = 'opentok-server-sdk'
version = '4.14.0'
sourceCompatibility = "1.8"
targetCompatibility = "1.8"

ext.githubPath = 'opentok/opentok-java-sdk'
ext.githubPath = "opentok/$archivesBaseName"
SMadani marked this conversation as resolved.
Show resolved Hide resolved

repositories {
mavenCentral()
}

dependencies {
testImplementation 'junit:junit:4.13.2'
testImplementation 'com.github.tomakehurst:wiremock-jre8:2.35.2'
testImplementation 'commons-fileupload:commons-fileupload:1.5'
testImplementation 'org.wiremock:wiremock:3.5.3'
testImplementation 'net.minidev:json-smart:2.5.1'
testImplementation 'com.google.guava:guava:32.1.3-jre'
testImplementation 'com.google.guava:guava:33.1.0-jre'

implementation 'commons-lang:commons-lang:2.6'
implementation 'commons-codec:commons-codec:1.16.1'
Expand All @@ -37,6 +34,16 @@ dependencies {
implementation 'org.bitbucket.b_c:jose4j:0.9.6'
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = sourceCompatibility
}

compileTestJava {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = sourceCompatibility
}

task sourcesJar(type: Jar) {
archiveClassifier.set("sources")
from sourceSets.main.allSource
Expand All @@ -50,6 +57,7 @@ task javadocJar(type: Jar) {
archiveClassifier.set("javadoc")
from javadoc
}

javadoc {
title = 'OpenTok Java SDK Reference'
destinationDir = file('docs')
Expand All @@ -71,11 +79,6 @@ jacocoTestReport {
}
check.dependsOn jacocoTestReport

java {
withSourcesJar()
withJavadocJar()
}

license {
header rootProject.file('codequality/HEADER')
ext.year = LocalDate.now().getYear()
Expand All @@ -85,6 +88,11 @@ artifacts {
archives javadocJar, sourcesJar
}

java {
withSourcesJar()
withJavadocJar()
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 4 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Thu Jan 04 09:44:51 GMT 2024
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading