Skip to content

[gha] enable gha build by default #16225

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 1 commit into from
Mar 8, 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
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .werft/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)");
Expand Down
6 changes: 3 additions & 3 deletions .werft/jobs/build/job-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface JobConfig {
certIssuer: string;
recreatePreview: boolean;
recreateVm: boolean;
withGitHubActions: boolean;
withWerft: boolean;
useWsManagerMk2: boolean;
withGceVm: boolean;
}
Expand Down Expand Up @@ -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"]) {
Expand Down Expand Up @@ -188,7 +188,7 @@ export function jobConfig(werft: Werft, context: any): JobConfig {
recreatePreview,
recreateVm,
withSlowDatabase,
withGitHubActions,
withWerft,
withDedicatedEmulation,
useWsManagerMk2,
withGceVm,
Expand Down