From c7c38ce86692d0aae616af0877a2be34ed281584 Mon Sep 17 00:00:00 2001 From: Aleksandar Aleksandrov Date: Wed, 8 Mar 2023 10:33:39 +0000 Subject: [PATCH] [gha] enable gha build by default --- .github/pull_request_template.md | 4 ++-- .github/workflows/build.yml | 12 ++++++------ .werft/build.ts | 2 +- .werft/jobs/build/job-config.ts | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9b3723c38095b4..42b3bf48a77463 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -31,8 +31,8 @@ Does this PR require updates to the documentation at www.gitpod.io/docs? ## Build Options: -- [ ] /werft with-github-actions - Experimental feature to run the build with GitHub Actions (and not in Werft). +- [ ] /werft with-werft + Run the build with werft instead of GHA - [ ] leeway-no-cache leeway-target=components:all - [ ] /werft no-test diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index df281e40dcb1ab..818d02198849a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,6 @@ jobs: outputs: is_main_branch: ${{ (github.head_ref || github.ref) == 'refs/heads/main' }} version: ${{ steps.branches.outputs.sanitized-branch-name }}-gha.${{github.run_number}} - with_github_actions: ${{ contains( steps.pr-details.outputs.pr_body, '[x] /werft with-github-actions') }} preview_enable: ${{ contains( steps.pr-details.outputs.pr_body, '[x] /werft with-preview') }} preview_infra_provider: ${{ contains( steps.pr-details.outputs.pr_body, '[X] /werft with-gce-vm') && 'gce' || 'harvester' }} build_no_cache: ${{ contains( steps.pr-details.outputs.pr_body, '[x] leeway-no-cache') }} @@ -37,6 +36,7 @@ jobs: analytics: ${{ contains( steps.pr-details.outputs.pr_body, '[X] analytics') }} workspace_feature_flags: ${{ steps.output.outputs.workspace_feature_flags }} pr_no_diff_skip: ${{ steps.pr-diff.outputs.pr_no_diff_skip }} + with_werft: ${{ steps.output.outputs.with-werft }} steps: - name: "Determine Branch" id: branches @@ -74,7 +74,7 @@ jobs: name: Build previewctl if: | (needs.configuration.outputs.pr_no_diff_skip != 'true') && - (needs.configuration.outputs.is_main_branch == 'true' || needs.configuration.outputs.preview_enable == 'true') + (needs.configuration.outputs.preview_enable == 'true') needs: [ configuration ] concurrency: group: ${{ github.head_ref || github.ref }}-build-previewctl @@ -112,7 +112,7 @@ jobs: needs: [ configuration, build-previewctl ] if: | (needs.configuration.outputs.pr_no_diff_skip != 'true') && - (needs.configuration.outputs.preview_enable == 'true' && needs.configuration.outputs.with_github_actions == 'true') + (needs.configuration.outputs.preview_enable == 'true') runs-on: [ self-hosted ] concurrency: group: ${{ github.head_ref || github.ref }}-infrastructure @@ -134,7 +134,7 @@ jobs: needs: [ configuration ] if: | (needs.configuration.outputs.pr_no_diff_skip != 'true') && - (needs.configuration.outputs.is_main_branch == 'true' || needs.configuration.outputs.with_github_actions == 'true') + (needs.configuration.outputs.with_github_actions == 'true') runs-on: [ self-hosted ] concurrency: group: ${{ github.head_ref || github.ref }}-build-gitpod @@ -223,9 +223,9 @@ jobs: PR_NO_TEST: ${{needs.configuration.outputs.build_no_test}} PR_LEEWAY_TARGET: ${{needs.configuration.outputs.build_leeway_target}} NPM_AUTH_TOKEN: '${{ steps.secrets.outputs.npm-auth-token }}' - PUBLISH_TO_NPM: ${{ needs.configuration.outputs.publish_to_npm == 'true' }} + PUBLISH_TO_NPM: ${{ needs.configuration.outputs.publish_to_npm == 'true' || needs.configuration.outputs.is_main_branch == 'true' }} JB_MARKETPLACE_PUBLISH_TOKEN: '${{ steps.secrets.outputs.jb-marketplace-publish-token }}' - PUBLISH_TO_JBPM: ${{ needs.configuration.outputs.publish_to_jbmp == 'true' }} + PUBLISH_TO_JBPM: ${{ needs.configuration.outputs.publish_to_jbmp == 'true' || needs.configuration.outputs.is_main_branch == 'true' }} CODECOV_TOKEN: '${{ steps.secrets.outputs.codecov-token }}' run: | [[ "$PR_NO_CACHE" = "true" ]] && CACHE="none" || CACHE="remote" diff --git a/.werft/build.ts b/.werft/build.ts index b860bc4742c866..814afd294ee4cd 100644 --- a/.werft/build.ts +++ b/.werft/build.ts @@ -54,7 +54,7 @@ Tracing.initialize() async function run(context: any) { const config = jobConfig(werft, context); - if(config.withGitHubActions) { + if(!config.withWerft) { werft.phase("Build Disabled"); werft.log("(not building)","The build is being performed via GitHub Actions; Thus, this Werft build does not run"); werft.done("(not building)"); diff --git a/.werft/jobs/build/job-config.ts b/.werft/jobs/build/job-config.ts index d3c7aa0880b207..8f8410cdfdba30 100644 --- a/.werft/jobs/build/job-config.ts +++ b/.werft/jobs/build/job-config.ts @@ -44,7 +44,7 @@ export interface JobConfig { certIssuer: string; recreatePreview: boolean; recreateVm: boolean; - withGitHubActions: boolean; + withWerft: boolean; useWsManagerMk2: boolean; withGceVm: boolean; } @@ -116,7 +116,7 @@ export function jobConfig(werft: Werft, context: any): JobConfig { const analytics = parseAnalytics(werft, sliceId, buildConfig["analytics"]) const withIntegrationTests = parseWithIntegrationTests(werft, sliceId, buildConfig["with-integration-tests"]); const withPreview = decideWithPreview({werft, sliceID: sliceId, buildConfig, mainBuild, withIntegrationTests}) - const withGitHubActions = "with-github-actions" in buildConfig; + const withWerft = "with-werft" in buildConfig; const withGceVm = "with-gce-vm" in buildConfig; switch (buildConfig["cert-issuer"]) { @@ -188,7 +188,7 @@ export function jobConfig(werft: Werft, context: any): JobConfig { recreatePreview, recreateVm, withSlowDatabase, - withGitHubActions, + withWerft, withDedicatedEmulation, useWsManagerMk2, withGceVm,