Skip to content

Commit

Permalink
Merge pull request #157 from com-pas/small-github-action-changes
Browse files Browse the repository at this point in the history
Small changes to GitHub Actions
  • Loading branch information
Dennis Labordus authored Aug 24, 2022
2 parents dcb9f2e + 2d4570d commit c573c6d
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2021 Alliander N.V.
# SPDX-FileCopyrightText: 2022 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/automate-projects.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2021 Alliander N.V.
# SPDX-FileCopyrightText: 2022 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/build-project.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2021 Alliander N.V.
# SPDX-FileCopyrightText: 2022 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -20,12 +20,15 @@ jobs:
timeout-minutes: 15

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK 1.11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'

- name: Create custom Maven Settings.xml
uses: whelk-io/maven-settings-xml-action@v20
with:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/release-project.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2021 Alliander N.V.
# SPDX-FileCopyrightText: 2022 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -15,17 +15,21 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Extract tag name
id: extract_tagname
shell: bash
# Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
# Extract the tag name from the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"

- name: Set up JDK 1.11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'

- name: Create custom Maven Settings.xml
uses: whelk-io/maven-settings-xml-action@v20
with:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/reuse.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2021 RTE FRANCE
# SPDX-FileCopyrightText: 2022 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -10,6 +10,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v1
- name: Checkout
uses: actions/checkout@v3
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v1
20 changes: 11 additions & 9 deletions .github/workflows/sonarcloud-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2021 RTE FRANCE
# SPDX-FileCopyrightText: 2022 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -25,14 +25,10 @@ jobs:

if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 1.11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'

- name: Cache SonarCloud packages
uses: actions/cache@v3
Expand All @@ -47,6 +43,12 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Set up JDK 1.11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'

- name: Set Common Sonar Variables
id: sonar_env
run: |
Expand All @@ -70,7 +72,7 @@ jobs:
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \
-Dsonar.pullrequest.base=${{ github.base_ref }} \
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} \
verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
- name: Build and analyze (Push)
if: ${{ github.event_name == 'push' }}
env:
Expand All @@ -80,4 +82,4 @@ jobs:
./mvnw -B -s custom_maven_settings.xml -Psonar \
${{ steps.sonar_env.outputs.sonar_opts }} \
-Dsonar.branch.name=${{ github.ref_name }} \
verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar

0 comments on commit c573c6d

Please sign in to comment.