Skip to content

Commit

Permalink
Add GitHub Actions Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
oranheim committed Sep 30, 2024
1 parent 177fc9e commit d418eee
Show file tree
Hide file tree
Showing 9 changed files with 398 additions and 42 deletions.
64 changes: 64 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
":dependencyDashboard",
"github>whitesource/merge-confidence:beta"
],
"packageRules": [
{
"matchManagers": [
"maven"
],
"matchUpdateTypes": [
"minor",
"patch",
"pin",
"digest"
],
"automerge": true
},
{
"matchDepTypes": [
"devDependencies"
],
"automerge": true
},
{
"excludePackageNames": [
"javax.xml.bind:jaxb-api"
],
"exclude": true
},
{
"excludePackageNames": [
"com.sun.xml.bind:jaxb-core",
"com.sun.xml.bind:jaxb-impl"
],
"exclude": true
},
{
"matchSourceUrlPrefixes": [
"https://github.com/junit-team/junit5"
],
"groupName": "junit5 monorepo",
"automerge": true
}
],
"vulnerabilityAlerts": {
"labels": [
"security"
],
"automerge": true
},
"lockFileMaintenance": {
"enabled": true,
"automerge": true
},
"rangeStrategy": "auto",
"dependencyDashboard": true,
"github-actions": {
"enabled": true,
"automerge": true
}
}
12 changes: 12 additions & 0 deletions .github/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">

<servers>
<server>
<id>ossrh</id>
<username>${env.MAVEN_USERNAME}</username>
<password>${env.MAVEN_PASSWORD}</password>
</server>
</servers>

</settings>
64 changes: 64 additions & 0 deletions .github/workflows/build-and-release-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build and Publish Snapshot

on:
push:
branches:
- master
tags-ignore:
- '**'
paths-ignore:
- '**.md'

env:
MAVEN_OPTS: ${{ vars.MAVEN_OPTS }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

# - name: Cache Maven packages
# uses: actions/cache@v3
# with:
# path: ~/.m2
# key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
# restore-keys: ${{ runner.os }}-m2

- name: Prepare Maven settings.xml
run: |
cat "${{ github.workspace }}/.github/settings.xml" > ~/.m2/settings.xml
- name: Build with Maven
run: mvn --batch-mode --update-snapshots package

- name: Publish Snapshot to OSS SonaType
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
run: |
mvn --batch-mode --no-transfer-progress deploy \
-DskipTests \
-P oss-sonatype
- name: Notify on success
if: success()
run: |
echo "Snapshot has been successfully deployed to OSS SonaType."
- name: Notify on failure
if: failure()
run: |
echo "Snapshot deployment failed. Please check the logs for more information."
36 changes: 36 additions & 0 deletions .github/workflows/build-and-verify-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Verify PRs

on:
pull_request:
branches:
- master
tags-ignore:
- '**'
paths-ignore:
- '**.md'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Prepare Maven settings.xml
run: |
cat "${{ github.workspace }}/.github/settings.xml" > ~/.m2/settings.xml
- name: Build with Maven
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
run: |
mvn --batch-mode --update-snapshots verify
44 changes: 44 additions & 0 deletions .github/workflows/coverage-and-sonar-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Coverage and Sonar Analysis

on:
push:
branches:
- master
tags:
- '[0-9]+.[0-9]+.[0-9]+'
paths-ignore:
- '**.md'

jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build, Test, and Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
run: |
mvn --batch-mode --no-transfer-progress clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
-P coverage,sonar \
-Dsonar.projectKey=descoped_rawdata-client-provider-gcs \
-Dsonar.organization=descoped \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# rawdata-client-provider-gcs

![Build Status](https://img.shields.io/github/actions/workflow/status/descoped/rawdata-client-provider-gcs/coverage-and-sonar-analysis.yml)
![Latest Tag](https://img.shields.io/github/v/tag/descoped/rawdata-client-provider-gcs)
![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=descoped_rawdata-client-provider-gcs&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=descoped_rawdata-client-provider-gcs) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=descoped_rawdata-client-provider-gcs&metric=coverage)](https://sonarcloud.io/summary/new_code?id=descoped_rawdata-client-provider-gcs)
[![Snyk Security Score](https://snyk.io/test/github/descoped/rawdata-client-provider-gcs/badge.svg)](https://snyk.io/test/github/descoped/rawdata-client-provider-gcs)

Rawdata provider for Google Cloud Storage.

Rawdata topics are organized such that each topic has a separate folder
Expand Down
Loading

0 comments on commit d418eee

Please sign in to comment.