Skip to content

Commit 6658605

Browse files
authored
feat(119): Update Github workflows (#224)
Signed-off-by: SaintierFr <[email protected]>
1 parent 7f6dbed commit 6658605

File tree

6 files changed

+148
-35
lines changed

6 files changed

+148
-35
lines changed

.github/dependabot.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# SPDX-FileCopyrightText: 2021 Alliander N.V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
version: 2
6+
7+
registries:
8+
maven-github:
9+
type: maven-repository
10+
url: https://maven.pkg.github.com/com-pas/*
11+
username: OWNER
12+
password: ${{ secrets.DB_GITHUB_PACKAGES }}
13+
14+
updates:
15+
# Maintain dependencies for GitHub Actions
16+
- package-ecosystem: "github-actions"
17+
directory: "/"
18+
schedule:
19+
interval: "weekly"
20+
open-pull-requests-limit: 5
21+
22+
# Maintain dependencies for Maven
23+
- package-ecosystem: "maven"
24+
directory: "/"
25+
registries:
26+
- maven-github
27+
schedule:
28+
interval: "weekly"
29+
open-pull-requests-limit: 5
30+
ignore:
31+
# Next dependencies shouldn't be upgrade automatically, because they need to update associated code
32+
- dependency-name: com.sun.xml.bind:jaxb-impl
33+
versions: [ "[2.3.3,)" ]
34+
- dependency-name: jakarta.xml.bind:jakarta.xml.bind-api
35+
versions: [ "[2.3.3,)" ]
36+
- dependency-name: org.glassfish.jaxb:jaxb-runtime
37+
versions: [ "[2.3.1,)" ]
38+
- dependency-name: jakarta.annotation:jakarta.annotation-api
39+
versions: [ "[1.3.5,)" ]
40+
- dependency-name: org.codehaus.mojo:jaxb2-maven-plugin
41+
versions: [ "[2.5.0,)" ]

.github/workflows/automate_projects.yml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,31 @@ jobs:
1313
if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
1414
steps:
1515
- name: add-new-issues-to-repository-based-project-column
16-
uses: docker://takanabe/github-actions-automate-projects:v0.0.1
1716
if: github.event_name == 'issues' && github.event.action == 'opened'
18-
env:
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20-
GITHUB_PROJECT_URL: https://github.com/com-pas/compas-sct/projects/1
21-
GITHUB_PROJECT_COLUMN_NAME: To do
17+
uses: alex-page/[email protected]
18+
with:
19+
project: CoMPAS SCT Board
20+
column: To do
21+
repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
2222
- name: add-new-pull-request-to-repository-based-project-column
23-
uses: docker://takanabe/github-actions-automate-projects:v0.0.1
2423
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened'
25-
env:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27-
GITHUB_PROJECT_URL: https://github.com/com-pas/compas-sct/projects/1
28-
GITHUB_PROJECT_COLUMN_NAME: To do
24+
uses: alex-page/[email protected]
25+
with:
26+
project: CoMPAS SCT Board
27+
column: To do
28+
repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
29+
2930
- name: add-new-issues-to-organization-based-project-column
30-
uses: docker://takanabe/github-actions-automate-projects:v0.0.1
3131
if: github.event_name == 'issues' && github.event.action == 'opened'
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
34-
GITHUB_PROJECT_URL: https://github.com/orgs/com-pas/projects/1
35-
GITHUB_PROJECT_COLUMN_NAME: To do
32+
uses: alex-page/[email protected]
33+
with:
34+
project: CoMPAS Issues Overview Board
35+
column: To do
36+
repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
3637
- name: add-new-pull-request-to-organization-based-project-column
37-
uses: docker://takanabe/github-actions-automate-projects:v0.0.1
3838
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened'
39-
env:
40-
GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
41-
GITHUB_PROJECT_URL: https://github.com/orgs/com-pas/projects/2
42-
GITHUB_PROJECT_COLUMN_NAME: To do
39+
uses: alex-page/[email protected]
40+
with:
41+
project: CoMPAS Pull Request Overview Board
42+
column: To do
43+
repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# SPDX-FileCopyrightText: 2021 Alliander N.V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: Build Project
6+
7+
on:
8+
push:
9+
branches:
10+
- '**'
11+
pull_request:
12+
branches:
13+
- 'main'
14+
- 'develop'
15+
16+
jobs:
17+
build:
18+
name: Build
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 15
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
26+
- name: Set up JDK 17
27+
uses: actions/setup-java@v3
28+
with:
29+
distribution: 'zulu'
30+
java-version: '17'
31+
32+
- name: Create custom Maven Settings.xml
33+
uses: whelk-io/maven-settings-xml-action@v21
34+
with:
35+
output_file: custom_maven_settings.xml
36+
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
37+
- name: Build with Maven
38+
run: mvn -s custom_maven_settings.xml -B clean verify

.github/workflows/release-project.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,23 @@ jobs:
1515
contents: read
1616
packages: write
1717
steps:
18-
- uses: actions/checkout@v3
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
1921
- name: Extract tag name
2022
id: extract_tagname
2123
shell: bash
2224
# Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
2325
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"
26+
2427
- name: Set up JDK 17
2528
uses: actions/setup-java@v3
2629
with:
2730
distribution: 'zulu'
2831
java-version: '17'
32+
2933
- name: Create custom Maven Settings.xml
30-
uses: whelk-io/maven-settings-xml-action@v20
34+
uses: whelk-io/maven-settings-xml-action@v21
3135
with:
3236
output_file: custom_maven_settings.xml
3337
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'

.github/workflows/reuse.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- name: Checkout
14+
uses: actions/checkout@v3
1415
- name: REUSE Compliance Check
1516
uses: fsfe/reuse-action@v1

.github/workflows/sonarcloud-analysis.yml

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,67 @@ jobs:
1010
build:
1111
name: Build
1212
runs-on: ubuntu-latest
13+
timeout-minutes: 15
14+
15+
if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
1316
steps:
14-
- uses: actions/checkout@v3
17+
- name: Checkout
18+
uses: actions/checkout@v3
1519
with:
1620
fetch-depth: 0
17-
- name: Set up JDK 17
18-
uses: actions/setup-java@v3
19-
with:
20-
distribution: 'zulu'
21-
java-version: '17'
21+
2222
- name: Cache SonarCloud packages
2323
uses: actions/cache@v3
2424
with:
2525
path: ~/.sonar/cache
2626
key: ${{ runner.os }}-sonar
2727
restore-keys: ${{ runner.os }}-sonar
28+
2829
- name: Cache Maven packages
2930
uses: actions/cache@v3
3031
with:
3132
path: ~/.m2
3233
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
3334
restore-keys: ${{ runner.os }}-m2
35+
36+
- name: Set up JDK 17
37+
uses: actions/setup-java@v3
38+
with:
39+
distribution: 'zulu'
40+
java-version: '17'
41+
42+
- name: Set Common Sonar Variables
43+
id: sonar_env
44+
run: |
45+
echo "##[set-output name=sonar_opts;]$(echo -Dsonar.host.url=https://sonarcloud.io \
46+
-Dsonar.projectKey=com-pas_compas-core \
47+
-Dsonar.organization=com-pas )"
3448
- name: Create custom Maven Settings.xml
35-
uses: whelk-io/maven-settings-xml-action@v18
49+
uses: whelk-io/maven-settings-xml-action@v21
3650
with:
3751
output_file: custom_maven_settings.xml
3852
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
39-
- name: Build and analyze
53+
54+
- name: Build and analyze (Pull Request)
55+
if: ${{ github.event_name == 'pull_request' || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
59+
run: |
60+
mvn -B -s custom_maven_settings.xml \
61+
${{ steps.sonar_env.outputs.sonar_opts }} \
62+
-Dsonar.pullrequest.branch=${{ github.ref_name }} \
63+
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \
64+
-Dsonar.pullrequest.base=${{ github.base_ref }} \
65+
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} \
66+
clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
67+
- name: Build and analyze (Push)
68+
if: ${{ github.event_name == 'push' }}
4069
env:
4170
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4271
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4372
run: |
4473
mvn -B -s custom_maven_settings.xml \
45-
-Dsonar.projectKey=com-pas_compas-sct \
46-
-Dsonar.organization=com-pas \
47-
-Dsonar.host.url=https://sonarcloud.io \
48-
verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
74+
${{ steps.sonar_env.outputs.sonar_opts }} \
75+
-Dsonar.branch.name=${{ github.ref_name }} \
76+
clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar

0 commit comments

Comments
 (0)