Skip to content

Commit

Permalink
gh-149 Add CI process for pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ghillert committed Jun 28, 2023
1 parent 1f46150 commit e0545bc
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 5 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI - Pull Request
on:
pull_request:
jobs:
build:
strategy:
matrix:
java-version: [ 17, 20 ]
runs-on: macos-latest
permissions:
checks: write
contents: read
issues: read
pull-requests: write
steps:
- uses: actions/checkout@v3.5.3
name: 📥 Checkout repository
with:
fetch-depth: 0
- name: 🔧 Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3.11.0
with:
distribution: 'oracle'
java-version: ${{ matrix.java-version }}
- name: 🫙 Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven2-
- name: 🛠 Build and test with ☕ Java ${{ matrix.java-version }}
run: |
git config --global user.email "github-action@users.noreply.github.com"
git config --global user.name "GitHub Action"
./mvnw clean install -B -Powasp -Pjdk${{ matrix.java-version }}
env:
GIT_COMMIT: ${{github.event.workflow_run.head_commit.id}}
HEAD_BRANCH: ${{github.event.workflow_run.head_branch}}
- name: 📊 Publish Test Report
if: always()
uses: mikepenz/action-junit-report@v3
with:
check_name: Java CI / Test Report (${{ matrix.java-version }})
report_paths: '**/target/surefire-reports/TEST-*.xml'
check_retries: 'true'
- name: 🧹 Clean Maven cache
run: |
find ~/.m2/repository -type d -name '*SNAPSHOT' | xargs rm -fr
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.oracle.bedrock.runtime.java.options.IPv4Preferred;
import com.oracle.bedrock.runtime.java.options.SystemProperty;
import com.oracle.bedrock.runtime.options.DisplayName;
import com.oracle.coherence.grpc.proxy.GrpcServerController;
import com.oracle.coherence.spring.configuration.annotation.CoherenceCache;
import com.oracle.coherence.spring.configuration.annotation.EnableCoherence;
import com.oracle.coherence.spring.configuration.session.GrpcSessionConfigurationBean;
Expand Down Expand Up @@ -75,9 +76,11 @@ static void setup() throws Exception {

@AfterAll
static void cleanup() {
GrpcServerController.INSTANCE.stop();
if (server != null) {
server.close();
}
Awaitility.await().atMost(70, TimeUnit.SECONDS).until(() -> !NetworkUtils.isGrpcPortInUse());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.oracle.bedrock.runtime.java.options.IPv4Preferred;
import com.oracle.bedrock.runtime.java.options.SystemProperty;
import com.oracle.bedrock.runtime.options.DisplayName;
import com.oracle.coherence.grpc.proxy.GrpcServerController;
import com.oracle.coherence.spring.configuration.annotation.CoherenceCache;
import com.oracle.coherence.spring.configuration.annotation.EnableCoherence;
import com.oracle.coherence.spring.configuration.session.SessionConfigurationBean;
Expand Down Expand Up @@ -72,9 +73,11 @@ static void setup() throws Exception {

@AfterAll
static void cleanup() {
GrpcServerController.INSTANCE.stop();
if (server != null) {
server.close();
}
Awaitility.await().atMost(70, TimeUnit.SECONDS).until(() -> !NetworkUtils.isGrpcPortInUse());
}

@Test
Expand Down
16 changes: 11 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<!-- project options -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>11</java.version>
<java.version>17</java.version>
<maven.minimum.version>3.6.0</maven.minimum.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<skip-sign-artifacts>true</skip-sign-artifacts>
Expand Down Expand Up @@ -124,7 +124,7 @@
<maven-enforcer-plugin.version>3.0.0</maven-enforcer-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<maven-install-plugin.version>2.5.2</maven-install-plugin.version>
<maven-jacoco-plugin.version>0.8.8</maven-jacoco-plugin.version>
<maven-jacoco-plugin.version>0.8.10</maven-jacoco-plugin.version>
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
<maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
Expand All @@ -145,7 +145,7 @@
<!-- dependency versions (alphabetically) -->
<assertj.version>3.24.1</assertj.version>
<awaitility.version>4.2.0</awaitility.version>
<bedrock.version>6.0.2</bedrock.version>
<bedrock.version>7.0.2</bedrock.version>
<coherence.groupId>com.oracle.coherence.ce</coherence.groupId>
<coherence.version>23.03</coherence.version>
<classgraph.version>4.8.115</classgraph.version>
Expand Down Expand Up @@ -568,9 +568,15 @@

<profiles>
<profile>
<id>jdk18</id>
<id>jdk17</id>
<properties>
<java.version>18</java.version>
<java.version>17</java.version>
</properties>
</profile>
<profile>
<id>jdk20</id>
<properties>
<java.version>20</java.version>
</properties>
</profile>
<profile>
Expand Down

0 comments on commit e0545bc

Please sign in to comment.