Skip to content

Commit f697bc6

Browse files
Merge pull request #246 from Turiok/feature/improve_CI
Feature/improve ci
2 parents 6c840d1 + d0f442a commit f697bc6

File tree

157 files changed

+267
-16569
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+267
-16569
lines changed

.github/dependatbot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/dependabot-options-reference#schedule-
6+
schedule:
7+
interval: "weekly"
8+
9+
- package-ecosystem: "maven"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"

.github/workflows/java-continuous-integration.yml

+37-14
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,52 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
java: [ '8', '11' ]
18+
java: [ '8', '11', '17', '21' ]
1919
name: Java ${{ matrix.Java }} CI
2020
steps:
21+
# the latest version at https://github.com/marketplace/actions/checkout
2122
- name: Check out repository code
22-
uses: actions/checkout@v2
23+
uses: actions/checkout@v4
2324
with:
2425
fetch-depth: 0
26+
# the latest version at https://github.com/marketplace/actions/setup-java-jdk
2527
- name: Setup java
26-
uses: actions/setup-java@v2
28+
uses: actions/setup-java@v4
2729
with:
2830
distribution: 'adopt'
2931
java-version: ${{ matrix.java }}
30-
- name: Cache Maven packages
31-
uses: actions/cache@v2
32+
cache: 'maven'
33+
# the latest version at https://github.com/actions/cache
34+
- name: Cache target folders
35+
uses: actions/cache@v4
3236
with:
33-
path: ~/.m2
34-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
35-
restore-keys: ${{ runner.os }}-m2
36-
- name: Cache node_modules
37-
uses: actions/cache@v2
38-
with:
39-
path: node_modules
40-
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
41-
restore-keys: ${{ runner.os }}-yarn-
37+
path: "**/target/"
38+
key: ${{ runner.os }}-cache-java-${{ matrix.java }}-${{ github.sha }}
4239
- name: Build with Maven
4340
run: mvn -B clean install
41+
quality:
42+
runs-on: ubuntu-latest
43+
needs: build
44+
steps:
45+
# the latest version at https://github.com/marketplace/actions/checkout
46+
- name: Check out repository code
47+
uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 0
50+
# the latest version at https://github.com/actions/cache
51+
- name: Restore cache
52+
uses: actions/cache/restore@v4
53+
with:
54+
path: "**/target/"
55+
fail-on-cache-miss: true
56+
key: ${{ runner.os }}-cache-java-21-${{ github.sha }}
57+
# the latest version at https://github.com/marketplace/actions/official-sonarqube-scan
58+
# Triggering SonarQube analysis as results of it are required by Quality Gate check.
59+
- name: SonarQube Scan
60+
uses: SonarSource/sonarqube-scan-action@v4
61+
with:
62+
args: >
63+
-Dsonar.qualitygate.wait=true
64+
-Dsonar.qualitygate.timeout=600
65+
env:
66+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/push-release.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Description
2+
# ===========
3+
# This workflow is triggered each time a release is created
4+
# It push I-Code to github repository
5+
---
6+
name: Push release
7+
8+
on:
9+
release:
10+
types: [created]
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
packages: write
18+
steps:
19+
- name: Check out repository code
20+
uses: actions/checkout@v4
21+
- name: Setup java
22+
uses: actions/setup-java@v4
23+
with:
24+
distribution: 'adopt'
25+
java-version: '11'
26+
- name: Cache Maven packages
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/.m2
30+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
31+
restore-keys: ${{ runner.os }}-m2
32+
- name: Publish on github repository
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
run: mvn --batch-mode deploy
36+
37+

.github/workflows/release.yml

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Description
2+
# ===========
3+
# This workflow is triggered each time a milestone is closed
4+
# It builds the jar, generates release notes, pushes a new tag
5+
# and makes a draft release with these elements.
6+
---
7+
name: Release
8+
9+
on:
10+
workflow_dispatch:
11+
inputs:
12+
draft:
13+
description: 'Est-ce que la release doit être en brouillon?'
14+
default: true
15+
required: false
16+
type: boolean
17+
prerelease:
18+
description: "Est-ce que c'est une pre-release?"
19+
default: true
20+
required: false
21+
type: boolean
22+
tag:
23+
description: "Spécifier le tag git?"
24+
required: true
25+
type: string
26+
maven_release_version:
27+
description: "Spécifier la version de release? Conseil: Utiliser la même version que le tag"
28+
required: true
29+
type: string
30+
maven_development_version:
31+
description: "Spécifier la nouvelle version de développement après la release? Ex : X.X.X-SNAPSHOT"
32+
required: true
33+
type: string
34+
35+
36+
jobs:
37+
release:
38+
runs-on: ubuntu-latest
39+
permissions:
40+
contents: write
41+
packages: write
42+
steps:
43+
- name: Check out repository code
44+
uses: actions/checkout@v4
45+
- name: Setup java
46+
uses: actions/setup-java@v4
47+
with:
48+
distribution: 'temurin'
49+
java-version: '11'
50+
- name: Maven install with new version
51+
run: |
52+
mvn -B versions:set-property -Dproperty=revision -DnewVersion="${{ inputs.maven_release_version }}"
53+
mvn -B -P prod install
54+
# the latest version at https://github.com/marketplace/actions/official-sonarqube-scan
55+
# Triggering SonarQube analysis as results of it are required by Quality Gate check.
56+
- name: SonarQube Scan
57+
uses: SonarSource/[email protected]
58+
with:
59+
args: >
60+
-Dsonar.qualitygate.wait=true
61+
-Dsonar.qualitygate.timeout=600
62+
env:
63+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
64+
- name: Commit and tag project
65+
run: |
66+
git config --global user.name "GitHub Actions"
67+
git config --global user.email [email protected]
68+
git add pom.xml
69+
git commit -m "Release ${{ inputs.tag }}"
70+
git push
71+
git tag ${{ inputs.tag }} -m "Release ${{ inputs.tag }}"
72+
git push origin ${{ inputs.tag }}
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
- name: Maven deploy
76+
run: |
77+
mvn -B -P prod deploy
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
- name: Bump up version in branch to next development version
81+
run: |
82+
git config --global user.name "GitHub Actions"
83+
git config --global user.email [email protected]
84+
mvn -B versions:set-property -Dproperty=revision -DnewVersion=${{ inputs.maven_development_version }}
85+
git add pom.xml
86+
git commit -m "Next development version is ${{ inputs.maven_development_version }}"
87+
git push
88+
env:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
- name: Set project values
91+
run: |
92+
echo "project=$(echo ${{ github.repository }} | awk -F '/' '{print $2}')" >> $GITHUB_ENV
93+
- name: Create GitHub Release
94+
uses: ncipollo/release-action@v1
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
with:
98+
artifacts: "icode-app/target/icode-*.zip"
99+
tag: ${{ inputs.tag }}
100+
name: ${{ env.project }} ${{ inputs.tag }}
101+
draft: ${{inputs.draft}}
102+
generateReleaseNotes: true
103+
prerelease: ${{inputs.prerelease}}
104+
token: ${{ secrets.GITHUB_TOKEN }}

export-csv/pom.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
<parent>
88
<groupId>fr.cnes.icode</groupId>
99
<artifactId>parent</artifactId>
10-
<version>dev</version>
10+
<version>${revision}</version>
1111
</parent>
1212

1313
<artifactId>export-csv</artifactId>
14-
<version>${icode.version}</version>
1514
<packaging>jar</packaging>
1615

1716
<name>Export CSV</name>
@@ -20,7 +19,7 @@
2019
<dependency>
2120
<groupId>fr.cnes.icode</groupId>
2221
<artifactId>icode-core</artifactId>
23-
<version>${icode.version}</version>
22+
<version>${project.version}</version>
2423
<scope>compile</scope>
2524
</dependency>
2625
</dependencies>

export-xml/pom.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
<parent>
88
<groupId>fr.cnes.icode</groupId>
99
<artifactId>parent</artifactId>
10-
<version>dev</version>
10+
<version>${revision}</version>
1111
</parent>
1212

1313
<artifactId>export-xml</artifactId>
14-
<version>${icode.version}</version>
1514
<packaging>jar</packaging>
1615

1716
<name>Export XML</name>
@@ -20,7 +19,7 @@
2019
<dependency>
2120
<groupId>fr.cnes.icode</groupId>
2221
<artifactId>icode-core</artifactId>
23-
<version>${icode.version}</version>
22+
<version>${project.version}</version>
2423
<scope>compile</scope>
2524
</dependency>
2625
<dependency>

fortran77-language/pom.xml

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
<parent>
88
<groupId>fr.cnes.icode</groupId>
99
<artifactId>parent</artifactId>
10-
<version>dev</version>
10+
<version>${revision}</version>
1111
</parent>
1212

1313
<artifactId>fortran77-language</artifactId>
14-
<version>${icode.version}</version>
1514
<packaging>jar</packaging>
1615

1716
<name>Fortran 77 language</name>
@@ -20,9 +19,9 @@
2019
<dependency>
2120
<groupId>fr.cnes.icode</groupId>
2221
<artifactId>icode-core</artifactId>
23-
<version>${icode.version}</version>
22+
<version>${project.version}</version>
2423
<scope>compile</scope>
2524
</dependency>
2625
</dependencies>
27-
26+
2827
</project>

fortran77-metrics/pom.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
<parent>
88
<groupId>fr.cnes.icode</groupId>
99
<artifactId>parent</artifactId>
10-
<version>dev</version>
10+
<version>${revision}</version>
1111
</parent>
1212

1313
<artifactId>fortran77-metrics</artifactId>
14-
<version>${icode.version}</version>
1514
<packaging>jar</packaging>
1615

1716
<name>Fortran 77 metrics</name>
@@ -20,7 +19,7 @@
2019
<dependency>
2120
<groupId>fr.cnes.icode</groupId>
2221
<artifactId>fortran77-language</artifactId>
23-
<version>${icode.version}</version>
22+
<version>${project.version}</version>
2423
<scope>compile</scope>
2524
</dependency>
2625
</dependencies>

fortran77-rules/pom.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
<parent>
88
<groupId>fr.cnes.icode</groupId>
99
<artifactId>parent</artifactId>
10-
<version>dev</version>
10+
<version>${revision}</version>
1111
</parent>
1212

1313
<artifactId>fortran77-rules</artifactId>
14-
<version>${icode.version}</version>
1514
<packaging>jar</packaging>
1615

1716
<name>Fortran 77 rules</name>
@@ -20,7 +19,7 @@
2019
<dependency>
2120
<groupId>fr.cnes.icode</groupId>
2221
<artifactId>fortran77-language</artifactId>
23-
<version>${icode.version}</version>
22+
<version>${project.version}</version>
2423
<scope>compile</scope>
2524
</dependency>
2625
</dependencies>

fortran90-language/pom.xml

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
<parent>
88
<groupId>fr.cnes.icode</groupId>
99
<artifactId>parent</artifactId>
10-
<version>dev</version>
10+
<version>${revision}</version>
1111
</parent>
1212

1313
<artifactId>fortran90-language</artifactId>
14-
<version>${icode.version}</version>
1514
<packaging>jar</packaging>
1615

1716
<name>Fortran 90 language</name>
@@ -20,9 +19,9 @@
2019
<dependency>
2120
<groupId>fr.cnes.icode</groupId>
2221
<artifactId>icode-core</artifactId>
23-
<version>${icode.version}</version>
22+
<version>${project.version}</version>
2423
<scope>compile</scope>
2524
</dependency>
2625
</dependencies>
27-
26+
2827
</project>

fortran90-metrics/pom.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
<parent>
88
<groupId>fr.cnes.icode</groupId>
99
<artifactId>parent</artifactId>
10-
<version>dev</version>
10+
<version>${revision}</version>
1111
</parent>
1212

1313
<artifactId>fortran90-metrics</artifactId>
14-
<version>${icode.version}</version>
1514
<packaging>jar</packaging>
1615

1716
<name>Fortran 90 metrics</name>
@@ -20,7 +19,7 @@
2019
<dependency>
2120
<groupId>fr.cnes.icode</groupId>
2221
<artifactId>fortran90-language</artifactId>
23-
<version>${icode.version}</version>
22+
<version>${project.version}</version>
2423
<scope>compile</scope>
2524
</dependency>
2625
</dependencies>

0 commit comments

Comments
 (0)