Skip to content

Commit

Permalink
Review workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
fugerit79 committed Feb 11, 2024
1 parent 1d66ddd commit 914da05
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 52 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/build_maven_compatibility.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# CI maven compatibility check
#
# version 1.0.0
#
# see : https://universe.fugerit.org/src/docs/conventions/workflows/build_maven_compatibility.html

name: CI maven compatibility check

Expand All @@ -13,21 +11,21 @@ on:
# a pull request.
push:
branches:
- develop
- branch-compatibility

jobs:
check-main:
runs-on: ${{ matrix.os }}
strategy:
matrix:
distribution: [ 'corretto' ]
java: [ '11', '17' ]
java: [ '11', '17', '21' ]
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
name: Java ${{ matrix.os }} ${{ matrix.java }} (${{ matrix.distribution }}) compatibility check
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@main
- name: Setup java
uses: actions/setup-java@v3
uses: actions/setup-java@main
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
Expand All @@ -42,9 +40,9 @@ jobs:
os: [ 'ubuntu-latest' ]
name: Java ${{ matrix.os }} ${{ matrix.java }} (${{ matrix.distribution }}) compatibility check
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@main
- name: Setup java
uses: actions/setup-java@v3
uses: actions/setup-java@main
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
Expand All @@ -55,13 +53,13 @@ jobs:
strategy:
matrix:
distribution: [ 'microsoft' ]
java: [ '11', '17' ]
java: [ '17' ]
os: [ 'windows-latest' ]
name: Java ${{ matrix.os }} ${{ matrix.java }} (${{ matrix.distribution }}) compatibility check
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@main
- name: Setup java
uses: actions/setup-java@v3
uses: actions/setup-java@main
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
Expand Down
31 changes: 15 additions & 16 deletions .github/workflows/build_maven_package.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# CI with maven build and scan
#
# version 1.0.0
#
# see : https://universe.fugerit.org/src/docs/conventions/workflows/build_maven_package.html

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: CI maven build and sonar cloud scan
name: CI maven build and scan

on:
# Trigger analysis when pushing in master or pull requests, and when creating
# a pull request.
push:
branches:
- main
- branch-sonarcloud
- develop
- branch-preview
pull_request:
types:
- opened
Expand All @@ -26,24 +25,24 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@main
with:
# Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@main
with:
java-version: '17'
distribution: 'corretto'
cache: 'maven'
- name: Cache Maven packages
uses: actions/cache@v1
uses: actions/cache@main
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Cache SonarCloud packages
uses: actions/cache@v1
uses: actions/cache@main
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
Expand All @@ -56,13 +55,13 @@ jobs:
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Build and analyze
run: mvn -B clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Pcoverage,full,metadata,sonarfugerit -Dsonar.projectKey=fugerit-org_${{github.event.repository.name}}
run: mvn -B clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Pcoverage,full,metadata,sonarfugerit,buildreact -Dsonar.projectKey=fugerit-org_${{github.event.repository.name}}
env:
# Needed to get some information about the pull request, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@v3.0.2
uses: advanced-security/maven-dependency-submission-action@main
38 changes: 18 additions & 20 deletions .github/workflows/deploy_maven_package.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# CI deploy maven package
#
# version 1.0.0
#
# see : https://universe.fugerit.org/src/docs/conventions/workflows/deploy_maven_package.html

name: CI deploy maven package

on:
push:
branches:
- deploy
- branch-deploy

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
- uses: actions/checkout@main
- name: Set up JDK 17
uses: actions/setup-java@main
with:
java-version: '11'
java-version: '17'
distribution: 'corretto'
cache: maven
- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.PASSPHRASE }}
nexus_username: ${{ secrets.OSS_USERNAME }}
nexus_password: ${{ secrets.OSS_PASSWORD }}
maven_args: -P doRelease
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish package
run: mvn --batch-mode deploy -P full,coverage,metadata
env:
MAVEN_USERNAME: ${{ secrets.OSS_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_PASSWORD }}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- review github workflows
- fugert org project conventions badge

## [1.5.2] - 2023-12-22

### Changed
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Main parent pom of fugerit-org projects.
[![Java runtime version](https://img.shields.io/badge/run%20on-java%208+-%23113366.svg?style=for-the-badge&logo=openjdk&logoColor=white)](https://universe.fugerit.org/src/docs/versions/java11.html)
[![Java build version](https://img.shields.io/badge/build%20on-java%2011+-%23ED8B00.svg?style=for-the-badge&logo=openjdk&logoColor=white)](https://universe.fugerit.org/src/docs/versions/java11.html)
[![Apache Maven](https://img.shields.io/badge/Apache%20Maven-3.9.0+-C71A36?style=for-the-badge&logo=Apache%20Maven&logoColor=white)](https://universe.fugerit.org/src/docs/versions/maven3_9.html)
[![Fugerit Github Project Conventions](https://img.shields.io/badge/Fugerit%20Org-Project%20Conventions-1A36C7?style=for-the-badge&logo=Onlinect%20Playground&logoColor=white)](https://universe.fugerit.org/src/docs/conventions/index.html)

0 comments on commit 914da05

Please sign in to comment.