Skip to content

Commit 5e71894

Browse files
committed
Review workflows
1 parent 85bc5d1 commit 5e71894

File tree

4 files changed

+60
-37
lines changed

4 files changed

+60
-37
lines changed
Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
1+
# CI with maven build and scan
2+
#
3+
# version 1.0.0
4+
#
5+
# see : https://universe.fugerit.org/src/docs/conventions/workflows/build_maven_package.html
36

4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
8-
9-
name: CI maven build and sonar cloud scan
7+
name: CI maven build and scan
108

119
on:
1210
# Trigger analysis when pushing in master or pull requests, and when creating
1311
# a pull request.
1412
push:
1513
branches:
1614
- main
17-
- branch-sonarcloud
15+
- develop
16+
- branch-preview
1817
pull_request:
1918
types:
2019
- opened
@@ -26,28 +25,31 @@ jobs:
2625
name: Build
2726
runs-on: ubuntu-latest
2827
steps:
29-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@main
3029
with:
3130
# Shallow clones should be disabled for a better relevancy of analysis
3231
fetch-depth: 0
3332
- name: Set up JDK 17
34-
uses: actions/setup-java@v4
33+
uses: actions/setup-java@main
3534
with:
3635
java-version: '17'
3736
distribution: 'corretto'
3837
cache: 'maven'
3938
- name: Cache Maven packages
40-
uses: actions/cache@v1
39+
uses: actions/cache@main
4140
with:
4241
path: ~/.m2
4342
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
4443
restore-keys: ${{ runner.os }}-m2
4544
- name: Cache SonarCloud packages
46-
uses: actions/cache@v1
45+
uses: actions/cache@main
4746
with:
4847
path: ~/.sonar/cache
4948
key: ${{ runner.os }}-sonar
5049
restore-keys: ${{ runner.os }}-sonar
50+
- uses: actions/setup-node@main
51+
with:
52+
node-version: 20
5153
- name: Maven version
5254
run: mvn -v
5355
env:
@@ -56,13 +58,33 @@ jobs:
5658
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
5759
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
5860
- name: Build and analyze
59-
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}}
61+
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}}
6062
env:
6163
# Needed to get some information about the pull request, if any
6264
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6365
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
6466
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
67+
# snyk
68+
- name: Build a Docker image
69+
run: docker build -t fj-doc-playground-quarkus fj-doc-playground-quarkus
70+
- name: Run Snyk to check Docker image for vulnerabilities
71+
# Snyk can be used to break the build when it detects vulnerabilities.
72+
# In this case we want to upload the issues to GitHub Code Scanning
73+
continue-on-error: true
74+
uses: snyk/actions/docker@master
75+
env:
76+
# In order to use the Snyk Action you will need to have a Snyk API token.
77+
# More details in https://github.com/snyk/actions#getting-your-snyk-token
78+
# or you can signup for free at https://snyk.io/login
79+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
80+
with:
81+
image: fj-doc-playground-quarkus
82+
args: --file=fj-doc-playground-quarkus/Dockerfile
83+
- name: Upload result to GitHub Code Scanning
84+
uses: github/codeql-action/upload-sarif@main
85+
with:
86+
sarif_file: snyk.sarif
6587

66-
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
88+
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
6789
- name: Update dependency graph
68-
uses: advanced-security/maven-dependency-submission-action@v3.0.2
90+
uses: advanced-security/maven-dependency-submission-action@main
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3-
4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
1+
# CI deploy maven package
2+
#
3+
# version 1.0.0
4+
#
5+
# see : https://universe.fugerit.org/src/docs/conventions/workflows/deploy_maven_package.html
86

97
name: CI deploy maven package
108

119
on:
1210
push:
1311
branches:
14-
- deploy
12+
- branch-deploy
1513

1614
jobs:
1715
build:
1816

1917
runs-on: ubuntu-latest
2018

2119
steps:
22-
- uses: actions/checkout@v3
23-
- name: Set up JDK 11
24-
uses: actions/setup-java@v3
20+
- uses: actions/checkout@main
21+
- name: Set up JDK 17
22+
uses: actions/setup-java@main
2523
with:
26-
java-version: '11'
24+
java-version: '17'
2725
distribution: 'corretto'
2826
cache: maven
29-
- name: Release Maven package
30-
uses: samuelmeuli/action-maven-publish@v1
31-
with:
32-
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
33-
gpg_passphrase: ${{ secrets.PASSPHRASE }}
34-
nexus_username: ${{ secrets.OSS_USERNAME }}
35-
nexus_password: ${{ secrets.OSS_PASSWORD }}
36-
maven_args: -P doRelease
27+
server-id: ossrh
28+
server-username: MAVEN_USERNAME
29+
server-password: MAVEN_PASSWORD
30+
- name: Build package
31+
run: mvn clean install -P full,coverage,metadata
32+
- name: Publish package
33+
run: mvn --batch-mode deploy
34+
env:
35+
MAVEN_USERNAME: ${{ secrets.OSS_USERNAME }}
36+
MAVEN_PASSWORD: ${{ secrets.OSS_PASSWORD }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
### Changed
1515

1616
- fj-bom set to 1.6.0
17+
- review workflows
1718

1819
## [8.4.7] - 2024-01-22
1920

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.fugerit.java</groupId>
99
<artifactId>fj-bom</artifactId>
10-
<version>1.5.2</version>
10+
<version>1.6.0</version>
1111
<relativePath></relativePath>
1212
</parent>
1313

0 commit comments

Comments
 (0)