Skip to content

Commit eebaae4

Browse files
authored
Call e2e test workflow from main build with installer version (#18381)
* Call e2e test workflow from build with installer version * Inherit secrets * Only run on main * Fix inputs.. * Only run on main
1 parent 8b4fbb4 commit eebaae4

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,18 @@ jobs:
409409
test_build_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
410410
test_build_ref: ${{ github.head_ref || github.ref }}
411411

412+
workspace-integration-tests-main:
413+
name: "Run workspace integration tests on main branch"
414+
needs:
415+
- configuration
416+
- build-gitpod
417+
- create-runner
418+
if: needs.configuration.outputs.is_main_branch == 'true'
419+
uses: ./.github/workflows/workspace-integration-tests.yml
420+
with:
421+
version: ${{ needs.configuration.outputs.version }}
422+
secrets: inherit
423+
412424
delete-runner:
413425
if: always()
414426
needs:

.github/workflows/workspace-integration-tests.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
name: "Workspace integration tests"
22
on:
3-
push:
4-
branches:
5-
- main
63
workflow_dispatch:
74
inputs:
85
name:
96
required: false
7+
type: string
108
description: "The name of the preview environment, or leave empty to use a default name"
119
version:
1210
required: false
11+
type: string
1312
description: "The version of Gitpod to install (leave empty to target the latest successful build on main)"
1413
skip_deploy:
1514
required: false
@@ -19,6 +18,16 @@ on:
1918
required: false
2019
type: boolean
2120
description: "Skip delete preview environment (debug only)"
21+
workflow_call:
22+
inputs:
23+
name:
24+
required: false
25+
type: string
26+
description: "The name of the preview environment, or leave empty to use a default name"
27+
version:
28+
required: false
29+
type: string
30+
description: "The version of Gitpod to install (leave empty to target the latest successful build on main)"
2231
schedule:
2332
- cron: "0 3,12 * * *"
2433

@@ -58,19 +67,19 @@ jobs:
5867
env:
5968
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6069
run: |
61-
if [[ '${{ github.event.inputs.name }}' != '' ]]; then
70+
if [[ '${{ inputs.name }}' != '' ]]; then
6271
{
63-
echo "name=${{ github.event.inputs.name }}"
72+
echo "name=${{ inputs.name }}"
6473
} >> $GITHUB_OUTPUT
6574
else
6675
{
6776
echo "name=workspace-integration-test-${{ github.run_id }}-${{ github.run_attempt }}"
6877
} >> $GITHUB_OUTPUT
6978
fi
7079
71-
if [[ '${{ github.event.inputs.version }}' != '' ]]; then
80+
if [[ '${{ inputs.version }}' != '' ]]; then
7281
{
73-
echo "version=${{ github.event.inputs.version }}"
82+
echo "version=${{ inputs.version }}"
7483
} >> $GITHUB_OUTPUT
7584
else
7685
# Find the most recent successful build on main. Look back up to 10 builds.
@@ -109,7 +118,7 @@ jobs:
109118
infrastructure_provider: gce
110119
large_vm: true
111120
- name: Deploy Gitpod to the preview environment
112-
if: github.event.inputs.skip_deploy != 'true'
121+
if: inputs.skip_deploy != 'true'
113122
id: deploy-gitpod
114123
uses: ./.github/actions/deploy-gitpod
115124
with:
@@ -150,7 +159,7 @@ jobs:
150159
delete:
151160
name: Delete preview environment
152161
needs: [configuration, infrastructure, check, create-runner]
153-
if: github.event.inputs.skip_delete != 'true' && always()
162+
if: inputs.skip_delete != 'true' && always()
154163
runs-on: ${{ needs.create-runner.outputs.label }}
155164
container:
156165
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aledbf-oci-tool-gha.14121

0 commit comments

Comments
 (0)