Skip to content

Commit

Permalink
Merge branch 'main' into feat-automate-releases-releasenotes
Browse files Browse the repository at this point in the history
  • Loading branch information
dvvanessastoiber committed Jun 24, 2024
2 parents e27af9a + b47f340 commit 55d9285
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 14 deletions.
14 changes: 14 additions & 0 deletions .github/actions/build-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ inputs:
run_webpack:
default: false
required: false
chromatic_enable:
description: 'Enable Chromatic tests'
required: false
type: boolean
default: false
chromatic_project_token:
description: 'Chromatic project token'
required: false

runs:
using: "composite"
Expand Down Expand Up @@ -107,3 +115,9 @@ runs:
with:
name: node-bundle
path: ./bundles
- name: Run Chromatic
if: inputs.chromatic_enable == 'true'
uses: chromaui/[email protected]
with:
projectToken: ${{ inputs.chromatic_project_token }}

15 changes: 9 additions & 6 deletions .github/workflows/build-node-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ on:
description: Unique id per workflow run. Must be set to unique value if dispatched multiple times for a single workflow.
default: ""
chromatic_enable:
description: 'Enable Chromatic Tests'
description: 'Enable Chromatic tests'
required: false
type: boolean
default: false
Expand Down Expand Up @@ -137,11 +137,8 @@ jobs:
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
run_webpack: ${{ inputs.node_run_webpack }}
enable_cache: ${{ inputs.runs_on != 'self-hosted' }}
- name: Run Chromatic
if: ${{ inputs.chromatic_enable }}
uses: chromaui/[email protected]
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
chromatic_enable: ${{ inputs.chromatic_enable }}
chromatic_project_token: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

build-python:
name: Python
Expand Down Expand Up @@ -219,6 +216,7 @@ jobs:
with:
ref: ${{ inputs.branch }}
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
fetch-depth: ${{ inputs.chromatic_enable && '0' || '1' }}
- name: Checkout github-workflows
uses: actions/checkout@v4
with:
Expand All @@ -233,6 +231,8 @@ jobs:
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
run_webpack: false # Disable the build here and call afterwards, as otherwise the yarn run env:decrypt will fail due to a missing yarn install
enable_cache: ${{ inputs.cypress_runs_on != 'self-hosted' && inputs.runs_on != 'self-hosted' }}
chromatic_enable: ${{ inputs.chromatic_enable }}
chromatic_project_token: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
- name: Build python
uses: ./tmp/github-workflows/.github/actions/build-python
with:
Expand Down Expand Up @@ -338,6 +338,7 @@ jobs:
with:
ref: ${{ inputs.branch }}
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
fetch-depth: ${{ inputs.chromatic_enable && '0' || '1' }}
- name: Checkout github-workflows
uses: actions/checkout@v4
with:
Expand All @@ -352,6 +353,8 @@ jobs:
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
run_webpack: false # Disable the build here and call afterwards, as otherwise the yarn run env:decrypt will fail due to a missing yarn install
enable_cache: ${{ inputs.playwright_runs_on != 'self-hosted' && inputs.runs_on != 'self-hosted' }}
chromatic_enable: ${{ inputs.chromatic_enable }}
chromatic_project_token: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
- name: Build python
uses: ./tmp/github-workflows/.github/actions/build-python
with:
Expand Down
36 changes: 29 additions & 7 deletions .github/workflows/build-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,27 @@ on:
type: string
required: false
default: ${{ github.ref || github.head_ref }}
chromatic_enable:
description: 'Enable Chromatic tests'
required: false
type: boolean
default: false
node_run_webpack:
description: "Flag to always run the webpack production build."
type: boolean
required: false
default: false
runs_on:
type: string
required: false
default: "ubuntu-22.04"
secrets:
DATAVISYN_BOT_REPO_TOKEN:
required: false
NODE_VERSION:
required: false
CHROMATIC_PROJECT_TOKEN:
required: false

env:
NPM_REGISTRY: "https://registry.npmjs.org/"
Expand All @@ -36,19 +52,25 @@ jobs:
contents: write
runs-on: ubuntu-22.04
steps:
# checkout specific source repository
- uses: actions/checkout@v3
- name: Checkout source repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }} # has to set because otherwise it will not work
# checkout this workflow repository to get actions
- uses: actions/checkout@v3
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
fetch-depth: ${{ inputs.chromatic_enable && '0' || '1' }}
- name: Checkout github-workflows
uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
path: ./tmp/github-workflows
- uses: ./tmp/github-workflows/.github/actions/build-node
- name: Build node
uses: ./tmp/github-workflows/.github/actions/build-node
with:
node_version: ${{ secrets.NODE_VERSION || env.NODE_VERSION }}
npm_registry: ${{ env.NPM_REGISTRY }}
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
run_webpack: ${{ inputs.node_run_webpack }}
enable_cache: ${{ inputs.runs_on != 'self-hosted' }}
chromatic_enable: ${{ inputs.chromatic_enable }}
chromatic_project_token: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/build-product.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ jobs:
workflow_file_name: "deploy-app.yml"
ref: ${{ env.WORKFLOW_BRANCH }}
github_user: ${{ secrets.DV_BOT_USER }}
client_payload: '{ "app": "${{ needs.prepare-build.outputs.app }}", "customer": "${{ steps.get-parameters.outputs.customer }}", "stage": "${{ steps.get-parameters.outputs.stage }}", "sub_app": "${{ needs.prepare-build.outputs.sub_app }}", "branch": "${{ needs.prepare-build.outputs.image_tag2 }}" }'
client_payload: '{ "app": "${{ needs.prepare-build.outputs.app }}", "customer": "${{ steps.get-parameters.outputs.customer }}", "stage": "${{ steps.get-parameters.outputs.stage }}", "sub_app": "${{ needs.prepare-build.outputs.sub_app }}", "branch": "${{ needs.prepare-build.outputs.image_tag2 }}", "image_tag": "${{ needs.prepare-build.outputs.image_tag1 }}" }'

0 comments on commit 55d9285

Please sign in to comment.