diff --git a/.github/workflows/nightly-pipeline.yml b/.github/workflows/nightly-pipeline.yml index ac2c5f0..79d9434 100644 --- a/.github/workflows/nightly-pipeline.yml +++ b/.github/workflows/nightly-pipeline.yml @@ -58,6 +58,7 @@ jobs: secrets: token: ${{ secrets.ACCESS_TOKEN }} IpIntelligenceUrl: ${{ secrets.IPI_DATA_FILE_URL }} + TestResourceKey: ${{ secrets._51DEGREES_RESOURCE_KEY_BESPOKE }} Publish: if: ${{ !cancelled() }} diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml index 9afd417..300883f 100644 --- a/.github/workflows/pull-requests.yml +++ b/.github/workflows/pull-requests.yml @@ -15,3 +15,4 @@ jobs: secrets: token: ${{ secrets.ACCESS_TOKEN }} IpIntelligenceUrl: ${{ secrets.IPI_DATA_FILE_URL }} + TestResourceKey: ${{ secrets._51DEGREES_RESOURCE_KEY_BESPOKE }} diff --git a/ci/README.md b/ci/README.md index c5cedc3..e6e9778 100644 --- a/ci/README.md +++ b/ci/README.md @@ -47,7 +47,7 @@ graph TD It performs the following steps: -1. Clone Examples Repo: Clone the "ip-intelligence-java-examples" repository into the common-ci directory. +1. Clone Examples Repo: Clone the "ip-intelligence-java-examples" repository into the common-ci directory. The branch with the same name as the one under test is used if it exists there, otherwise `main`. 3. Set up test files: Move the 51Degrees-EnterpriseIpiV41.ipi file to the ip-intelligence-java-examples/ip-intelligence-data directory and download Evidence files into ip-intelligence-data directory. 4. Enter ip-intelligence-examples directory: Changes the current working directory to the ip-intelligence-java-examples folder. 5. Set package dependency version: Sets the version of the ip-intelligence package dependency for the examples to the specified Version parameter. This will be the version installed in the local repository found in the .m2 folder. diff --git a/ci/run-integration-tests.ps1 b/ci/run-integration-tests.ps1 index ae57d36..069aef9 100644 --- a/ci/run-integration-tests.ps1 +++ b/ci/run-integration-tests.ps1 @@ -20,6 +20,12 @@ $RepoPath = [IO.Path]::Combine($pwd, $RepoName) $mavenOpts = '--batch-mode', '--no-transfer-progress' try { + # The branch under test usually has no twin in the examples repo + if (!(git ls-remote --heads "https://github.com/$OrgName/$ExamplesRepo" "refs/heads/$Branch")) { + Write-Output "No '$Branch' branch in '$ExamplesRepo', using 'main'" + $Branch = "main" + } + Write-Output "Cloning '$ExamplesRepo'" ./steps/clone-repo.ps1 -RepoName $ExamplesRepo -OrgName $OrgName -Branch $Branch & "./$ExamplesRepo/ci/fetch-assets.ps1" -IpIntelligenceUrl $IpIntelligenceUrl diff --git a/ci/run-performance-tests.ps1 b/ci/run-performance-tests.ps1 index b016b53..9d257dc 100644 --- a/ci/run-performance-tests.ps1 +++ b/ci/run-performance-tests.ps1 @@ -19,6 +19,12 @@ if (!$IpIntelligenceUrl) { if (Test-Path $ExamplesRepo) { Write-Host "Examples already cloned, skipping" } else { + # The branch under test usually has no twin in the examples repo + if (!(git ls-remote --heads "https://github.com/$OrgName/$ExamplesRepo" "refs/heads/$Branch")) { + Write-Host "No '$Branch' branch in '$ExamplesRepo', using 'main'" + $Branch = "main" + } + Write-Host "Cloning '$ExamplesRepo'" ./steps/clone-repo.ps1 -RepoName $ExamplesRepo -OrgName $OrgName -Branch $Branch & "./$ExamplesRepo/ci/fetch-assets.ps1" -IpIntelligenceUrl $IpIntelligenceUrl