diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c3b2e4a..d9c5541 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Alliander N.V. +# SPDX-FileCopyrightText: 2022 Alliander N.V. # # SPDX-License-Identifier: Apache-2.0 diff --git a/.github/workflows/automate-projects.yml b/.github/workflows/automate-projects.yml index bcb7268..3c61af0 100644 --- a/.github/workflows/automate-projects.yml +++ b/.github/workflows/automate-projects.yml @@ -1,10 +1,10 @@ -# SPDX-FileCopyrightText: 2021 Alliander N.V. +# SPDX-FileCopyrightText: 2022 Alliander N.V. # # SPDX-License-Identifier: Apache-2.0 name: Add issues and pull request to project boards -on: [issues, pull_request, pull_request_target] +on: [ issues, pull_request, pull_request_target ] jobs: github-actions-automate-projects: @@ -12,31 +12,17 @@ jobs: if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }} steps: - - name: add-new-issues-to-repository-based-project-column - uses: docker://takanabe/github-actions-automate-projects:v0.0.1 - if: github.event_name == 'issues' && github.event.action == 'opened' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_PROJECT_URL: https://github.com/com-pas/compas-cim-mapping/projects/2 - GITHUB_PROJECT_COLUMN_NAME: To do - - name: add-new-pull-request-to-repository-based-project-column - uses: docker://takanabe/github-actions-automate-projects:v0.0.1 - if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_PROJECT_URL: https://github.com/com-pas/compas-cim-mapping/projects/2 - GITHUB_PROJECT_COLUMN_NAME: To do - name: add-new-issues-to-organization-based-project-column - uses: docker://takanabe/github-actions-automate-projects:v0.0.1 if: github.event_name == 'issues' && github.event.action == 'opened' - env: - GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_ACTION_SECRET }} - GITHUB_PROJECT_URL: https://github.com/orgs/com-pas/projects/1 - GITHUB_PROJECT_COLUMN_NAME: To do + uses: alex-page/github-project-automation-plus@v0.8.1 + with: + project: CoMPAS Issues Overview Board + column: To do + repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }} - name: add-new-pull-request-to-organization-based-project-column - uses: docker://takanabe/github-actions-automate-projects:v0.0.1 if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened' - env: - GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_ACTION_SECRET }} - GITHUB_PROJECT_URL: https://github.com/orgs/com-pas/projects/2 - GITHUB_PROJECT_COLUMN_NAME: To do + uses: alex-page/github-project-automation-plus@v0.8.1 + with: + project: CoMPAS Pull Request Overview Board + column: To do + repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }} diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml index fd82244..614fbf5 100644 --- a/.github/workflows/build-project.yml +++ b/.github/workflows/build-project.yml @@ -22,9 +22,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 + - name: Cache Docker Register uses: actions/cache@v3 with: @@ -37,6 +35,9 @@ jobs: key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 - name: Set up JDK 17 uses: actions/setup-java@v3 with: diff --git a/.github/workflows/release-project.yml b/.github/workflows/release-project.yml index e34cef1..ff3e633 100644 --- a/.github/workflows/release-project.yml +++ b/.github/workflows/release-project.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Alliander N.V. +# SPDX-FileCopyrightText: 2022 Alliander N.V. # # SPDX-License-Identifier: Apache-2.0 @@ -12,17 +12,12 @@ jobs: push_to_registry: name: Build and publish runs-on: ubuntu-latest + timeout-minutes: 15 + steps: - name: Checkout uses: actions/checkout@v3 - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_TOKEN }} + - name: Cache Docker Register uses: actions/cache@v3 with: @@ -38,13 +33,22 @@ jobs: - 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/. + # Extract the tag name from the git reference, value of GITHUB_REF will be something like refs/tags/. run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})" + - name: Set up JDK 17 uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: '17' + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} - name: Create custom Maven Settings.xml uses: whelk-io/maven-settings-xml-action@v20 diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml index 5317feb..9ebd56d 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Alliander N.V. +# SPDX-FileCopyrightText: 2022 Alliander N.V. # # SPDX-License-Identifier: Apache-2.0 @@ -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 diff --git a/.github/workflows/sonarcloud-analysis.yml b/.github/workflows/sonarcloud-analysis.yml index e5889e9..0c66235 100644 --- a/.github/workflows/sonarcloud-analysis.yml +++ b/.github/workflows/sonarcloud-analysis.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Alliander N.V. +# SPDX-FileCopyrightText: 2022 Alliander N.V. # # SPDX-License-Identifier: Apache-2.0 @@ -25,14 +25,11 @@ 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 17 - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '17' + - name: Cache SonarCloud packages uses: actions/cache@v3 with: @@ -46,20 +43,43 @@ jobs: key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '17' + + - name: Set Common Sonar Variables + id: sonar_env + run: | + echo "##[set-output name=sonar_opts;]$(echo -Dsonar.host.url=https://sonarcloud.io \ + -Dsonar.projectKey=com-pas_compas-cim-mapping \ + -Dsonar.organization=com-pas )" - name: Create custom Maven Settings.xml uses: whelk-io/maven-settings-xml-action@v20 with: output_file: custom_maven_settings.xml servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]' - - name: Build and analyze + - name: Build and analyze (Pull Request) + if: ${{ github.event_name == 'pull_request' || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + ./mvnw -B -s custom_maven_settings.xml -Psonar \ + ${{ steps.sonar_env.outputs.sonar_opts }} \ + -Dsonar.pullrequest.branch=${{ github.ref_name }} \ + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ + -Dsonar.pullrequest.base=${{ github.base_ref }} \ + -Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} \ + clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar + - name: Build and analyze (Push) + if: ${{ github.event_name == 'push' }} env: - GITHUB_USERNAME: "OWNER" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | - ./mvnw -s custom_maven_settings.xml -B -Psonar \ - -Dsonar.projectKey=com-pas_compas-cim-mapping \ - -Dsonar.organization=com-pas \ - -Dsonar.host.url=https://sonarcloud.io \ - -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ - clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar + ./mvnw -B -s custom_maven_settings.xml -Psonar \ + ${{ steps.sonar_env.outputs.sonar_opts }} \ + -Dsonar.branch.name=${{ github.ref_name }} \ + clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar diff --git a/pom.xml b/pom.xml index 90d17de..e1024d1 100644 --- a/pom.xml +++ b/pom.xml @@ -23,12 +23,12 @@ SPDX-License-Identifier: Apache-2.0 3.0.0-M7 3.2.0 - 0.9.1 + 0.9.3 - 2.11.2.Final + 2.12.2.Final 3.0 - 1.7.36 - 4.9.2 + 2.0.1 + 4.10.1 1.5.2.Final 0.9.1 @@ -161,7 +161,7 @@ SPDX-License-Identifier: Apache-2.0 org.apache.maven.plugins maven-jar-plugin - 3.2.2 + 3.3.0 @@ -250,7 +250,7 @@ SPDX-License-Identifier: Apache-2.0 org.apache.maven.plugins maven-javadoc-plugin - 3.4.0 + 3.4.1 attach-javadocs