Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Feat/migrate to GitHub actions (#278)
Browse files Browse the repository at this point in the history
* Build: Add Configuration for GitHub Actions and remove the Travis-CI.org configuration
  • Loading branch information
tunderwood authored Nov 12, 2020
1 parent e35bfda commit 8861632
Show file tree
Hide file tree
Showing 7 changed files with 914 additions and 58 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Build

on:
push:
branches:
- '*'
pull_request:
branches:
- master
schedule:
- cron: "0 22 * * 1"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew check build buildDashboard generateAggregatedReports -x integrationTest --continue
- name: Test and publish coverage to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: ./gradlew coverallsJacoco
- name: Slack notification when master build fails
if: ${{ failure() && github.ref == 'refs/heads/master'}}
uses: rtCamp/[email protected]
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: cerberus-alerts
SLACK_MESSAGE: 'Cerberus main build has failed :build-failed:'
SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
SLACK_TITLE: Cerberus Build Failure Notification
SLACK_USERNAME: GitHub Actions
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Release

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
Build-and-Release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew check build buildDashboard generateAggregatedReports -x integrationTest --continue
- name: Test and publish coverage to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: ./gradlew coverallsJacoco
- name: Release artifact to Bintray
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY}}
run: ./gradlew bintrayUpload
- name: Upload binary to GitHub release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: cerberus-web/build/libs/cerberus.jar
tag: ${{ github.ref }}
- name: Upload checksum to GitHub release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: cerberus-web/build/libs/cerberus.jar.MD5
tag: ${{ github.ref }}
- name: Slack notification when release fails
if: ${{ failure() }}
uses: rtCamp/[email protected]
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: cerberus-alerts
SLACK_MESSAGE: 'Cerberus release workflow has failed :build-failed:'
SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
SLACK_TITLE: Cerberus Build Failure Notification
SLACK_USERNAME: GitHub Actions
48 changes: 0 additions & 48 deletions .travis.yml

This file was deleted.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cerberus

[![][travis img]][travis]
![][gh actions img]
[![][coveralls img]][coveralls]
[![][license img]][license]

Expand Down Expand Up @@ -147,8 +147,7 @@ server.ssl:
Cerberus Management Service is released under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
[travis]:https://travis-ci.org/Nike-Inc/cerberus
[travis img]:https://api.travis-ci.org/Nike-Inc/cerberus.svg?branch=master
[gh actions img]:https://github.com/Nike-Inc/cerberus/workflows/Build/badge.svg?branch=chore%2FGH_Actions
[license]:LICENSE.txt
[license img]:https://img.shields.io/badge/License-Apache%202-blue.svg
Expand Down
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ buildscript {
maven {
url "https://plugins.gradle.org/m2/"
}
google()
}

dependencies {
Expand All @@ -49,7 +50,7 @@ buildscript {

plugins {
id "io.spring.dependency-management" version "1.0.9.RELEASE"
id "com.github.kt3k.coveralls" version "2.9.0"
id "com.github.nbaztec.coveralls-jacoco" version "1.2.4"
}

apply from: 'gradle/owasp-dependency-check.gradle'
Expand Down Expand Up @@ -81,6 +82,7 @@ allprojects {
repositories {
jcenter()
mavenCentral()
google()
}

jacoco {
Expand Down Expand Up @@ -189,11 +191,9 @@ task aggregatedJacocoReport(type: JacocoReport, group: 'Coverage reports') {
}
}

coveralls {
sourceDirs = publishedProjects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath = "${buildDir}/reports/jacoco/aggregatedJacocoReport/aggregatedJacocoReport.xml"
saveAsFile = true
sendToCoveralls = false
coverallsJacoco {
reportSourceSets = publishedProjects.sourceSets.main.allSource.srcDirs.flatten()
reportPath = "${buildDir}/reports/jacoco/aggregatedJacocoReport/aggregatedJacocoReport.xml"
}

configurations {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
# limitations under the License.
#

version=4.9.1
version=4.9.2
group=com.nike.cerberus
springBootVersion=2.3.4.RELEASE
Loading

0 comments on commit 8861632

Please sign in to comment.