Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
iQQBot committed Apr 24, 2024
1 parent 45e666b commit b4b72d0
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 18 deletions.
38 changes: 34 additions & 4 deletions .github/actions/integration-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,49 @@ inputs:
integration_test_usertoken:
description: "The username for integration test"
required: true

identity_provider:
description: "GCP workload identity provider"
required: true
service_account:
description: "GCP service account"
required: true
leeway_segment_key:
description: "leeway analytics key"
required: true
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- id: env-vars
name: configure env variables
shell: bash
run: |
{
echo "LEEWAY_SEGMENT_KEY=${{ inputs.leeway_segment_key }}"
echo "LEEWAY_WORKSPACE_ROOT=$GITHUB_WORKSPACE"
echo "HOME=/home/gitpod"
} >> "$GITHUB_ENV"
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: "${{ inputs.identity_provider }}"
service_account: "${{ inputs.service_account }}"
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
skip_install: true
- id: docker
name: configure docker
shell: bash
run: |
gcloud auth configure-docker eu.gcr.io --quiet
- name: Setup
shell: bash
env:
PREVIEW_NAME: ${{ inputs.preview_name }}
run: |
export LEEWAY_WORKSPACE_ROOT="$(pwd)"
leeway run dev/preview/previewctl:install
previewctl install-context --branch "${PREVIEW_NAME}" --log-level debug --timeout 10m
- name: Integration Test
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -402,13 +402,6 @@ jobs:
group: ${{ needs.configuration.outputs.preview_name }}-integration-test
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-environment
with:
identity_provider: ${{ secrets.DEV_PREVIEW_PROVIDER }}
service_account: ${{ secrets.DEV_PREVIEW_SA }}
leeway_segment_key: ${{ secrets.LEEWAY_SEGMENT_KEY }}

- name: Run integration test
id: integration-test
uses: ./.github/actions/integration-tests
Expand All @@ -421,6 +414,11 @@ jobs:
test_build_id: ${{ github.run_id }}
test_build_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
test_build_ref: ${{ github.head_ref || github.ref }}
identity_provider: ${{ secrets.DEV_PREVIEW_PROVIDER }}
service_account: ${{ secrets.DEV_PREVIEW_SA }}
leeway_segment_key: ${{ secrets.LEEWAY_SEGMENT_KEY }}
integration_test_username: ${{ secrets.WORKSPACE_INTEGRATION_TEST_USERNAME }}
integration_test_usertoken: ${{ secrets.WORKSPACE_INTEGRATION_TEST_USER_TOKEN }}

workspace-integration-tests-main:
name: "Run workspace integration tests on main branch"
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/workspace-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,6 @@ jobs:
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:pd-test-new-preview-gha.24525
steps:
- uses: actions/checkout@v4
- name: Setup Environment
uses: ./.github/actions/setup-environment
with:
identity_provider: ${{ secrets.DEV_PREVIEW_PROVIDER }}
service_account: ${{ secrets.DEV_PREVIEW_SA }}
leeway_segment_key: ${{ secrets.LEEWAY_SEGMENT_KEY }}
- name: Integration Test
id: integration-test
uses: ./.github/actions/integration-tests
Expand All @@ -168,6 +161,11 @@ jobs:
test_suite: workspace
notify_slack_webhook: ${{ secrets.WORKSPACE_SLACK_WEBHOOK }}
github_token: ${{ secrets.GITHUB_TOKEN }}
identity_provider: ${{ secrets.DEV_PREVIEW_PROVIDER }}
service_account: ${{ secrets.DEV_PREVIEW_SA }}
leeway_segment_key: ${{ secrets.LEEWAY_SEGMENT_KEY }}
integration_test_username: ${{ secrets.WORKSPACE_INTEGRATION_TEST_USERNAME }}
integration_test_usertoken: ${{ secrets.WORKSPACE_INTEGRATION_TEST_USER_TOKEN }}

delete:
name: Delete preview environment
Expand Down

0 comments on commit b4b72d0

Please sign in to comment.