Skip to content

Commit 869b880

Browse files
committed
Update build.yml
1 parent 54160db commit 869b880

File tree

2 files changed

+65
-7
lines changed

2 files changed

+65
-7
lines changed

.github/workflows/build.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,53 @@
1-
name: build
1+
name: Build repository
22

33
on:
44
workflow_dispatch:
55
inputs:
6+
run_parallel:
7+
description: 'Run jobs in parallel'
8+
required: false
9+
type: boolean
10+
default: true
11+
self_hosted:
12+
description: 'Run on self-hosted runner'
13+
required: false
14+
type: boolean
15+
default: true
616
cypress:
717
description: 'Run cypress'
818
required: false
919
type: boolean
1020
default: false
21+
playwright:
22+
description: 'Run playwright'
23+
required: false
24+
type: boolean
25+
default: false
26+
playwright_spec_param:
27+
type: string
28+
description: 'Run specific playwright test(s) (optional). Example: landing-page.spec.ts'
29+
required: false
1130
push:
31+
pull_request:
32+
types: [opened, ready_for_review]
33+
pull_request_review:
34+
types: [submitted]
1235

1336
jobs:
1437
build:
38+
if: ${{ github.event_name != 'pull_request_review' || github.event.review.state == 'approved' }}
1539
uses: datavisyn/github-workflows/.github/workflows/build-node-python.yml@main
1640
secrets: inherit
41+
# 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
42+
# To get on push true, use !contains(inputs.myInput, 'false')
43+
# To get on push false, use contains(inputs.myInput, 'true')
1744
with:
45+
run_parallel: ${{ !contains(inputs.run_parallel, 'false') }} # true except if box is not checked
46+
runs_on: ${{ (!contains(inputs.self_hosted, 'false') && 'self-hosted') || null }} # self-hosted except if box is not checked
1847
cypress_enable: true
19-
cypress_run_because_flag: ${{ inputs.cypress == true }}
48+
cypress_run_because_flag: ${{ inputs.cypress == true || github.event_name == 'pull_request' || github.event.review.state == 'approved' }}
49+
cypress_runs_on: ${{ (!contains(inputs.self_hosted, 'false') && 'self-hosted') || null }} # self-hosted except if box is not checked
50+
playwright_enable: false
51+
playwright_run_because_flag: ${{ inputs.playwright == true || github.event_name == 'pull_request' || github.event.review.state == 'approved' }}
52+
playwright_spec_param: ${{ inputs.playwright_spec_param }}
53+
playwright_runs_on: ${{ (!contains(inputs.self_hosted, 'false') && 'self-hosted') || null }} # self-hosted except if box is not checked

.github/workflows/release.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
1-
name: release
1+
name: Create a new release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_version:
7+
type: string
8+
description: 'The next version to release'
9+
required: true
10+
pull_request:
11+
types: [closed]
12+
branches:
13+
- 'main'
214

3-
on: workflow_dispatch
4-
515
jobs:
6-
release:
16+
create_release_pr:
17+
if: ${{ github.event_name == 'workflow_dispatch' }}
718
uses: datavisyn/github-workflows/.github/workflows/release-source.yml@main
8-
secrets: inherit
19+
secrets: inherit
20+
with:
21+
release_version: ${{ inputs.release_version }}
22+
is_helm_chart: false
23+
24+
post_merge_release:
25+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.title, 'Release') }}
26+
uses: datavisyn/github-workflows/.github/workflows/release-post-merge.yml@main
27+
secrets: inherit
28+
with:
29+
pr_title: ${{ github.event.pull_request.title }}
30+
pr_number: ${{ github.event.pull_request.number }}
31+
repository_owner: ${{ github.repository_owner }}
32+
repository_name: ${{ github.event.repository.name }}

0 commit comments

Comments
 (0)