Skip to content

Call e2e test workflow from main build with installer version #18381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,18 @@ jobs:
test_build_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
test_build_ref: ${{ github.head_ref || github.ref }}

workspace-integration-tests-main:
name: "Run workspace integration tests on main branch"
needs:
- configuration
- build-gitpod
- create-runner
if: needs.configuration.outputs.is_main_branch == 'true'
uses: ./.github/workflows/workspace-integration-tests.yml
with:
version: ${{ needs.configuration.outputs.version }}
secrets: inherit

delete-runner:
if: always()
needs:
Expand Down
27 changes: 18 additions & 9 deletions .github/workflows/workspace-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name: "Workspace integration tests"
on:
push:
branches:
- main
workflow_dispatch:
inputs:
name:
required: false
type: string
description: "The name of the preview environment, or leave empty to use a default name"
version:
required: false
type: string
description: "The version of Gitpod to install (leave empty to target the latest successful build on main)"
skip_deploy:
required: false
Expand All @@ -19,6 +18,16 @@ on:
required: false
type: boolean
description: "Skip delete preview environment (debug only)"
workflow_call:
inputs:
name:
required: false
type: string
description: "The name of the preview environment, or leave empty to use a default name"
version:
required: false
type: string
description: "The version of Gitpod to install (leave empty to target the latest successful build on main)"
schedule:
- cron: "0 3,12 * * *"

Expand Down Expand Up @@ -58,19 +67,19 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ '${{ github.event.inputs.name }}' != '' ]]; then
if [[ '${{ inputs.name }}' != '' ]]; then
{
echo "name=${{ github.event.inputs.name }}"
echo "name=${{ inputs.name }}"
} >> $GITHUB_OUTPUT
else
{
echo "name=workspace-integration-test-${{ github.run_id }}-${{ github.run_attempt }}"
} >> $GITHUB_OUTPUT
fi

if [[ '${{ github.event.inputs.version }}' != '' ]]; then
if [[ '${{ inputs.version }}' != '' ]]; then
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for workflow_call github.event.inputs.* doesnt exist and need to use inputs.* instead. Works now: https://github.com/gitpod-io/gitpod/actions/runs/5692256844/job/15429016661?pr=18381#step:6:12

inputs.* is also available for workflow_dispatch

{
echo "version=${{ github.event.inputs.version }}"
echo "version=${{ inputs.version }}"
} >> $GITHUB_OUTPUT
else
# Find the most recent successful build on main. Look back up to 10 builds.
Expand Down Expand Up @@ -109,7 +118,7 @@ jobs:
infrastructure_provider: gce
large_vm: true
- name: Deploy Gitpod to the preview environment
if: github.event.inputs.skip_deploy != 'true'
if: inputs.skip_deploy != 'true'
id: deploy-gitpod
uses: ./.github/actions/deploy-gitpod
with:
Expand Down Expand Up @@ -150,7 +159,7 @@ jobs:
delete:
name: Delete preview environment
needs: [configuration, infrastructure, check, create-runner]
if: github.event.inputs.skip_delete != 'true' && always()
if: inputs.skip_delete != 'true' && always()
runs-on: ${{ needs.create-runner.outputs.label }}
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aledbf-oci-tool-gha.14121
Expand Down