From 306492bd03ccfdd0f30767ef5cb9a6c033c9d80e Mon Sep 17 00:00:00 2001 From: Joris Mancini Date: Fri, 6 Sep 2024 16:43:30 +0200 Subject: [PATCH 1/4] chore: add a CI job with maven install Signed-off-by: Joris Mancini --- .github/workflows/maven.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..ad78eea --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,24 @@ +name: CI + +on: + push: + branches: + - 'main' + pull_request: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + + - name: Checkout sources + uses: actions/checkout@v1 + + - name: Build with Maven + run: mvn --batch-mode -P jacoco install From 4722c0efc994fc7253901063c5b81fc867bd5427 Mon Sep 17 00:00:00 2001 From: Joris Mancini Date: Fri, 6 Sep 2024 17:07:43 +0200 Subject: [PATCH 2/4] chore: change maven target to verify Signed-off-by: Joris Mancini --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index ad78eea..b1e6bfa 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -21,4 +21,4 @@ jobs: uses: actions/checkout@v1 - name: Build with Maven - run: mvn --batch-mode -P jacoco install + run: mvn --batch-mode -P jacoco verify From 83b1d0778332135a2d70ae72e8e1355ebe8a407d Mon Sep 17 00:00:00 2001 From: Joris Mancini Date: Fri, 6 Sep 2024 17:35:42 +0200 Subject: [PATCH 3/4] chore: add sonar analysis Signed-off-by: Joris Mancini --- .github/workflows/maven.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index b1e6bfa..05507c0 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -22,3 +22,13 @@ jobs: - name: Build with Maven run: mvn --batch-mode -P jacoco verify + + - name: Run SonarCloud analysis + run: > + mvn --batch-mode -DskipTests sonar:sonar + -Dsonar.host.url=https://sonarcloud.io + -Dsonar.organization=powsybl-ci-github + -Dsonar.projectKey=com.powsybl:powsybl-ws-commons + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From b15b09bf02d99e1e84043a430036401b85b3cb15 Mon Sep 17 00:00:00 2001 From: Joris Mancini Date: Mon, 9 Sep 2024 09:23:42 +0200 Subject: [PATCH 4/4] chore: add broadcast event and triggers on release branch and version tags Signed-off-by: Joris Mancini --- .github/workflows/maven.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 05507c0..ae56014 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -4,6 +4,9 @@ on: push: branches: - 'main' + - 'release-v**' + tags: + - 'v[0-9]*' pull_request: jobs: @@ -21,7 +24,7 @@ jobs: uses: actions/checkout@v1 - name: Build with Maven - run: mvn --batch-mode -P jacoco verify + run: mvn --batch-mode -Pjacoco verify - name: Run SonarCloud analysis run: > @@ -32,3 +35,11 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + - name: Broadcast update event + if: github.ref == 'refs/heads/main' + uses: gridsuite/broadcast-event@main + with: + token: ${{ secrets.REPO_ACCESS_TOKEN }} + organizations: gridsuite + event-type: ws_commons_updated