Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
puehringer authored Sep 3, 2024
1 parent c51fd85 commit 92284eb
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,46 @@
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
playwright:
description: 'Run playwright'
required: false
type: boolean
default: false
playwright_spec_param:
type: string
description: "Run specific test(s). Example: `landing-page.spec.ts`"
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: false
playwright_enable: true
playwright_run_because_flag: ${{ inputs.playwright == true }}
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

0 comments on commit 92284eb

Please sign in to comment.