From 56fd0c1c370adfabf210d39988fe038c17434224 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Thu, 17 Oct 2024 13:11:07 +0200 Subject: [PATCH 1/5] Run integration tests after each deployment This PR starts an `integration-test` job, whenever a snapshot or release is deployed. --- .github/workflows/build.yaml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ac7d6128ffc..793eaf9dcad 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -30,7 +30,7 @@ jobs: build: if: github.actor != 'dependabot[bot]' - uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/11.3.0 + uses: apache/logging-parent/.github/workflows/build-reusable.yaml@feature/reproducibility-check secrets: DV_ACCESS_TOKEN: ${{ startsWith(github.ref_name, 'release/') && '' || secrets.GE_ACCESS_TOKEN }} with: @@ -43,8 +43,10 @@ jobs: deploy-snapshot: needs: build - if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x' - uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@rel/11.3.0 + # FIXME: Restore `2.x` before merging + # if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x' + if: github.repository == 'apache/logging-log4j2' && github.ref_name == 'feature/2.x/run-integration-tests' + uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@feature/reproducibility-check # Secrets for deployments secrets: NEXUS_USERNAME: ${{ secrets.NEXUS_USER }} @@ -57,7 +59,7 @@ jobs: deploy-release: needs: build if: github.repository == 'apache/logging-log4j2' && startsWith(github.ref_name, 'release/') - uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@rel/11.3.0 + uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@feature/reproducibility-check # Secrets for deployments secrets: GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }} @@ -73,3 +75,14 @@ jobs: 8 17 project-id: log4j + + # Run integration-tests automatically after a snapshot or RC is published + integration-test: + needs: [ deploy-snapshot, deploy-release ] + if: ${{ always() && (needs.deploy-snapshot.result == 'success' || needs.deploy-release.result == 'success') }} + uses: apache/logging-log4j-samples/.github/workflows/integration-test.yaml@main + with: + log4j-version: ${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.project-version || needs.deploy-snapshot.outputs.project-version }} + log4j-repository-url: ${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.nexus-url || needs.deploy-snapshot.outputs.nexus-url }} + # Use the `main` branch of `logging-log4j-samples` + samples-ref: 'refs/heads/main' From e2a001bc424cbb41ce8d2887ab44c21afe327ee7 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Thu, 17 Oct 2024 13:24:10 +0200 Subject: [PATCH 2/5] Deploy snapshots for #3105 with a special version --- .github/workflows/build.yaml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fcab0748442..07f830a7a85 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -45,7 +45,7 @@ jobs: needs: build # FIXME: Restore `2.x` before merging # if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x' - if: github.repository == 'apache/logging-log4j2' && github.ref_name == 'feature/2.x/run-integration-tests' + if: github.repository == 'apache/logging-log4j2' && github.ref == 'refs/pull/3105/merge' uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@feature/reproducibility-check # Secrets for deployments secrets: diff --git a/pom.xml b/pom.xml index 88bf7db62ff..035ef4574a7 100644 --- a/pom.xml +++ b/pom.xml @@ -306,7 +306,7 @@ - 2.25.0-SNAPSHOT + 2.25.0.pr3105-SNAPSHOT 2.24.1 2.24.1 From ae55b3aca1d80c5f6ce2f32c6a5d4e350c942b9d Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Thu, 17 Oct 2024 15:09:47 +0200 Subject: [PATCH 3/5] Add version to job name --- .github/workflows/build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 07f830a7a85..a79a9da0ef8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -79,6 +79,7 @@ jobs: verify-reproducibility: needs: [ deploy-snapshot, deploy-release ] if: ${{ always() && (needs.deploy-snapshot.result == 'success' || needs.deploy-release.result == 'success') }} + name: "Verify reproducibility (`${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.project-version || needs.deploy-snapshot.outputs.project-version }}`)" uses: apache/logging-parent/.github/workflows/verify-reproducibility-reusable.yaml@feature/reproducibility-check with: nexus-url: ${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.nexus-url || needs.deploy-snapshot.outputs.nexus-url }} @@ -91,6 +92,7 @@ jobs: integration-test: needs: [ deploy-snapshot, deploy-release ] if: ${{ always() && (needs.deploy-snapshot.result == 'success' || needs.deploy-release.result == 'success') }} + name: "Integration tests (`${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.project-version || needs.deploy-snapshot.outputs.project-version }}`)" uses: apache/logging-log4j-samples/.github/workflows/integration-test.yaml@main with: log4j-version: ${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.project-version || needs.deploy-snapshot.outputs.project-version }} From 7d9bc6ff8ebcdf62c469937f1475dda3b6d6543b Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Thu, 17 Oct 2024 16:09:13 +0200 Subject: [PATCH 4/5] No need for `ref` input --- .github/workflows/build.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a79a9da0ef8..ca58dc03411 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -83,8 +83,6 @@ jobs: uses: apache/logging-parent/.github/workflows/verify-reproducibility-reusable.yaml@feature/reproducibility-check with: nexus-url: ${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.nexus-url || needs.deploy-snapshot.outputs.nexus-url }} - # Checkout the repository by branch name, since the deployment job might add commits to the branch - ref: ${{ github.ref_name }} # Encode the `runs-on` input as JSON array runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]' From 69a44af9a0ae231261c90b55b5926d799e074add Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Thu, 17 Oct 2024 17:12:54 +0200 Subject: [PATCH 5/5] Shorten job names --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ca58dc03411..7ac0d4a12b6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -79,7 +79,7 @@ jobs: verify-reproducibility: needs: [ deploy-snapshot, deploy-release ] if: ${{ always() && (needs.deploy-snapshot.result == 'success' || needs.deploy-release.result == 'success') }} - name: "Verify reproducibility (`${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.project-version || needs.deploy-snapshot.outputs.project-version }}`)" + name: "verify-reproducibility (${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.project-version || needs.deploy-snapshot.outputs.project-version }})" uses: apache/logging-parent/.github/workflows/verify-reproducibility-reusable.yaml@feature/reproducibility-check with: nexus-url: ${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.nexus-url || needs.deploy-snapshot.outputs.nexus-url }} @@ -90,7 +90,7 @@ jobs: integration-test: needs: [ deploy-snapshot, deploy-release ] if: ${{ always() && (needs.deploy-snapshot.result == 'success' || needs.deploy-release.result == 'success') }} - name: "Integration tests (`${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.project-version || needs.deploy-snapshot.outputs.project-version }}`)" + name: "integration-test (${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.project-version || needs.deploy-snapshot.outputs.project-version }})" uses: apache/logging-log4j-samples/.github/workflows/integration-test.yaml@main with: log4j-version: ${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.project-version || needs.deploy-snapshot.outputs.project-version }}