Skip to content

Commit

Permalink
COH-31609 Create a proper build pipeline on GitHub
Browse files Browse the repository at this point in the history
(merge 14.1.1.0 -> ce/14.1.1.0 113572)

[git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v14.1.1.0/": change = 113575]
  • Loading branch information
thegridman committed Jan 16, 2025
1 parent ec83705 commit 6ddd3fb
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 39 deletions.
58 changes: 37 additions & 21 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
# Copyright 2020 Oracle Corporation and/or its affiliates. All rights reserved.
# Copyright 2020, 2025, Oracle Corporation and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.

# ---------------------------------------------------------------------------
# Coherence CE GitHub Actions CI build.
# ---------------------------------------------------------------------------

name: CI Build
name: Parallel CI Build

on:
workflow_dispatch:
push:
branches-ignore:
- gh-pages
- p4-integ*
- last-p4-*
pull_request:
types:
- opened
- committed
branches:
- '*'
workflow_call:
inputs:
runner:
default: ubuntu-latest
required: true
type: string

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}
strategy:
fail-fast: false
matrix:
Expand All @@ -45,7 +43,7 @@ jobs:

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

- name: Set up JDK
uses: actions/setup-java@v1
Expand All @@ -56,7 +54,7 @@ jobs:
run: mvn -version

- name: Cache Maven packages
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand Down Expand Up @@ -87,15 +85,33 @@ jobs:
# Upload build artifacts for diagnosing failures
- name: Build Artifacts test logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-output
name: test-output-${{ matrix.stage }}
path: prj/**/target/test-output/**/*
if-no-files-found: ignore

- name: Build Artifacts test reports
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-reports
name: failsafe-surefire-test-reports-${{ matrix.stage }}
path: prj/**/target/*-reports/**/*
if-no-files-found: ignore

- name: Build Artifacts core dumps
uses: actions/upload-artifact@v4
if: failure()
with:
name: core-dumps-${{ matrix.stage }}
path: prj/**/core.*
if-no-files-found: ignore

- name: Build Artifacts compiler replays
uses: actions/upload-artifact@v4
if: failure()
with:
name: compiler-replay-logs-${{ matrix.stage }}
path: prj/**/replay_pid*.log
if-no-files-found: ignore
36 changes: 36 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2020, 2025, Oracle Corporation and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.

# ---------------------------------------------------------------------------
# Coherence CE GitHub Actions CI build.
# ---------------------------------------------------------------------------

name: CI Pipeline

on:
workflow_dispatch:
push:
branches-ignore:
- gh-pages
- p4-integ*
- last-p4-*

jobs:
build:
name: Parallel Build - Linux
uses: ./.github/workflows/build.yaml
secrets: inherit
with:
runner: ubuntu-latest

deploy:
if: github.repository == 'oracle/coherence' && (github.ref_name == 'main' || startsWith(github.ref_name, 'v1') || startsWith(github.ref_name, 'v2') || startsWith(github.ref_name, 'v3'))
name: Deploy Snapshot
uses: ./.github/workflows/deploy-snapshots.yaml
with:
runner: ubuntu-latest
secrets: inherit
needs:
- build
44 changes: 26 additions & 18 deletions .github/workflows/deploy-snapshots.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright 2025, Oracle Corporation and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.

# This workflow will build a Java project with Maven and deploy snapshot
# artifacts to Maven Central
#
Expand All @@ -8,32 +13,34 @@
name: Deploy to Maven Central

on:
workflow_run:
workflows: ["CI Build"]
branches: [ master, v20.12, v21.06, v21.12, v14.1.1.0 ]
types:
- completed
workflow_call:
inputs:
runner:
default: ubuntu-latest
required: true
type: string

env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
GIT_USER: ${{ secrets.BOT_USERNAME }}
GIT_EMAIL: ${{ secrets.BOT_EMAIL }}
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false

jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}

runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/checkout@v4

- name: Set up Java 11
uses: actions/setup-java@v1
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
java-version: '11'

- name: Cache Maven packages
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand All @@ -43,6 +50,7 @@ jobs:
env:
MAVEN_USER: ${{ secrets.MavenUser }}
MAVEN_PASSWORD: ${{ secrets.MavenPassword }}
GIT_COMMIT: ${{github.event.workflow_run.head_commit.id}}
HEAD_BRANCH: ${{github.event.workflow_run.head_branch}}
run: sh tools/bin/github-deploy-snapshot.sh
run: |
git config --local user.name "${GIT_USER}"
git config --local user.email "${GIT_EMAIL}"
sh tools/bin/github-deploy-snapshots.sh

0 comments on commit 6ddd3fb

Please sign in to comment.