|
36 | 36 | workspace_feature_flags: ${{ steps.output.outputs.workspace_feature_flags }}
|
37 | 37 | pr_no_diff_skip: ${{ steps.pr-diff.outputs.pr_no_diff_skip }}
|
38 | 38 | with_werft: ${{ steps.output.outputs.with-werft }}
|
| 39 | + with_integration_tests: ${{ steps.output.outputs.with_integration_tests }} |
39 | 40 | steps:
|
40 | 41 | - name: "Determine Branch"
|
41 | 42 | id: branches
|
|
66 | 67 | run: |
|
67 | 68 | {
|
68 | 69 | echo "workspace_feature_flags=$(echo "$PR_DESC" | grep -oP '(?<=\[X\] workspace-feature-flags).*')"
|
| 70 | + echo "with_integration_tests=$(echo "$PR_DESC" | grep -oiP '(?<=\[x\] with-integration-tests=).*')" |
69 | 71 | } >> $GITHUB_OUTPUT
|
70 | 72 |
|
71 | 73 | build-previewctl:
|
@@ -315,3 +317,42 @@ jobs:
|
315 | 317 | with:
|
316 | 318 | sa_key: ${{ secrets.GCP_CREDENTIALS }}
|
317 | 319 | previewctl_hash: ${{ needs.build-previewctl.outputs.previewctl_hash }}
|
| 320 | + |
| 321 | + integration-test: |
| 322 | + name: "Run integration test" |
| 323 | + needs: [ configuration, build-previewctl, build-gitpod, infrastructure, install ] |
| 324 | + runs-on: [ self-hosted ] |
| 325 | + if: needs.configuration.outputs.with_integration_tests != '' |
| 326 | + concurrency: |
| 327 | + group: ${{ github.head_ref || github.ref_name }}-integration-test |
| 328 | + cancel-in-progress: true |
| 329 | + steps: |
| 330 | + - uses: actions/checkout@v3 |
| 331 | + - name: Run integration test |
| 332 | + shell: bash |
| 333 | + env: |
| 334 | + ROBOQUAT_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 335 | + INTEGRATION_TEST_USERNAME: ${{ secrets.IDE_INTEGRATION_TEST_USERNAME }} |
| 336 | + INTEGRATION_TEST_USER_TOKEN: ${{ secrets.IDE_INTEGRATION_TEST_USER_TOKEN }} |
| 337 | + PREVIEW_ENV_DEV_SA_KEY: ${{ secrets.GCP_CREDENTIALS }} |
| 338 | + PREVIEW_NAME: ${{ github.head_ref || github.ref_name }} |
| 339 | + TEST_SUITS: ${{ needs.configuration.outputs.with_integration_tests }} |
| 340 | + run: | |
| 341 | + set -euo pipefail |
| 342 | +
|
| 343 | + export LEEWAY_WORKSPACE_ROOT="$(pwd)" |
| 344 | + export HOME="/home/gitpod" |
| 345 | + export PREVIEW_ENV_DEV_SA_KEY_PATH="/home/gitpod/.config/gcloud/preview-environment-dev-sa.json" |
| 346 | +
|
| 347 | + echo "${PREVIEW_ENV_DEV_SA_KEY}" > "${PREVIEW_ENV_DEV_SA_KEY_PATH}" |
| 348 | + gcloud auth activate-service-account --key-file "${PREVIEW_ENV_DEV_SA_KEY_PATH}" |
| 349 | +
|
| 350 | + leeway run dev/preview/previewctl:install |
| 351 | +
|
| 352 | + echo "Setting up access to core-dev and harvester" |
| 353 | + previewctl get-credentials --gcp-service-account "${PREVIEW_ENV_DEV_SA_KEY_PATH}" |
| 354 | +
|
| 355 | + previewctl install-context --branch "${PREVIEW_NAME}" --log-level debug --timeout 1m --gcp-service-account "${PREVIEW_ENV_DEV_SA_KEY_PATH}" |
| 356 | +
|
| 357 | + $GITHUB_WORKSPACE/test/run.sh -s ${TEST_SUITS} |
| 358 | +
|
0 commit comments