Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
puehringer committed Jan 13, 2025
1 parent 54160db commit 869b880
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 7 deletions.
38 changes: 36 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,53 @@
name: build
name: Build repository

on:
workflow_dispatch:
inputs:
run_parallel:
description: 'Run jobs in parallel'
required: false
type: boolean
default: true
self_hosted:
description: 'Run on self-hosted runner'
required: false
type: boolean
default: true
cypress:
description: 'Run cypress'
required: false
type: boolean
default: false
playwright:
description: 'Run playwright'
required: false
type: boolean
default: false
playwright_spec_param:
type: string
description: 'Run specific playwright test(s) (optional). Example: landing-page.spec.ts'
required: false
push:
pull_request:
types: [opened, ready_for_review]
pull_request_review:
types: [submitted]

jobs:
build:
if: ${{ github.event_name != 'pull_request_review' || github.event.review.state == 'approved' }}
uses: datavisyn/github-workflows/.github/workflows/build-node-python.yml@main
secrets: inherit
# Boolean inputs are tricky in Github Actions. Their default is not honored in non-workflow-dispatch actions, so setting a default on push is tricky: https://stackoverflow.com/a/73495922
# To get on push true, use !contains(inputs.myInput, 'false')
# To get on push false, use contains(inputs.myInput, 'true')
with:
run_parallel: ${{ !contains(inputs.run_parallel, 'false') }} # true except if box is not checked
runs_on: ${{ (!contains(inputs.self_hosted, 'false') && 'self-hosted') || null }} # self-hosted except if box is not checked
cypress_enable: true
cypress_run_because_flag: ${{ inputs.cypress == true }}
cypress_run_because_flag: ${{ inputs.cypress == true || github.event_name == 'pull_request' || github.event.review.state == 'approved' }}
cypress_runs_on: ${{ (!contains(inputs.self_hosted, 'false') && 'self-hosted') || null }} # self-hosted except if box is not checked
playwright_enable: false
playwright_run_because_flag: ${{ inputs.playwright == true || github.event_name == 'pull_request' || github.event.review.state == 'approved' }}
playwright_spec_param: ${{ inputs.playwright_spec_param }}
playwright_runs_on: ${{ (!contains(inputs.self_hosted, 'false') && 'self-hosted') || null }} # self-hosted except if box is not checked
34 changes: 29 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
name: release
name: Create a new release

on:
workflow_dispatch:
inputs:
release_version:
type: string
description: 'The next version to release'
required: true
pull_request:
types: [closed]
branches:
- 'main'

on: workflow_dispatch

jobs:
release:
create_release_pr:
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: datavisyn/github-workflows/.github/workflows/release-source.yml@main
secrets: inherit
secrets: inherit
with:
release_version: ${{ inputs.release_version }}
is_helm_chart: false

post_merge_release:
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.title, 'Release') }}
uses: datavisyn/github-workflows/.github/workflows/release-post-merge.yml@main
secrets: inherit
with:
pr_title: ${{ github.event.pull_request.title }}
pr_number: ${{ github.event.pull_request.number }}
repository_owner: ${{ github.repository_owner }}
repository_name: ${{ github.event.repository.name }}

0 comments on commit 869b880

Please sign in to comment.