diff --git a/.github/workflows/build-node-python.yml b/.github/workflows/build-node-python.yml index 9125fa3a..a4bd5a17 100644 --- a/.github/workflows/build-node-python.yml +++ b/.github/workflows/build-node-python.yml @@ -28,10 +28,6 @@ on: type: boolean required: false default: false - runs_on: - type: string - required: false - default: "ubuntu-20.04" secrets: DATAVISYN_BOT_REPO_TOKEN: required: false @@ -66,7 +62,7 @@ jobs: permissions: id-token: write contents: write - runs-on: ${{ inputs.runs_on }} + runs-on: ubuntu-20.04 steps: - name: Checkout source repository uses: actions/checkout@v3 @@ -93,7 +89,7 @@ jobs: concurrency: group: "python-${{ github.workflow }}-${{ github.ref || github.head_ref }}-${{ inputs.branch }}" cancel-in-progress: true - runs-on: ${{ inputs.runs_on }} + runs-on: ubuntu-20.04 steps: - name: Checkout source repository uses: actions/checkout@v3 @@ -122,7 +118,7 @@ jobs: permissions: id-token: write contents: write - runs-on: ${{ inputs.runs_on }} + runs-on: ubuntu-20.04 services: postgres: @@ -136,6 +132,8 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 + ports: + - 5432:5432 steps: - name: Checkout source repository diff --git a/.github/workflows/build-product.yml b/.github/workflows/build-product.yml index 8dfeba4e..b69b1583 100644 --- a/.github/workflows/build-product.yml +++ b/.github/workflows/build-product.yml @@ -2,6 +2,11 @@ name: build-product on: workflow_call: + inputs: + timeout: + description: "Timeout in minutes for each job" + type: string + default: 30 secrets: DATAVISYN_BOT_REPO_TOKEN: required: false @@ -58,6 +63,7 @@ jobs: create_workspace: ${{ steps.get-parameters.outputs.create_workspace }} stage: ${{ steps.get-parameters.outputs.stage }} runs-on: ubuntu-20.04 + timeout-minutes: ${{ fromJSON(inputs.timeout) }} steps: # checkout specific repository - uses: actions/checkout@v3 @@ -100,6 +106,7 @@ jobs: image_tag2: ${{ needs.prepare-build.outputs.image_tag2 }} build_time: ${{ needs.prepare-build.outputs.build_time }} stage: ${{ needs.prepare-build.outputs.stage }} + timeout: ${{ inputs.timeout }} secrets: inherit build-workspace: needs: prepare-build @@ -115,9 +122,11 @@ jobs: image_tag2: ${{ needs.prepare-build.outputs.image_tag2 }} build_time: ${{ needs.prepare-build.outputs.build_time }} stage: ${{ needs.prepare-build.outputs.stage }} + timeout: ${{ inputs.timeout }} secrets: inherit post-build: needs: [prepare-build, build-single, build-workspace] + timeout-minutes: ${{ fromJSON(inputs.timeout) }} if: ${{ always() && (needs.build-single.result == 'success' || needs.build-single.result == 'skipped') && (needs.build-workspace.result == 'success' || needs.build-workspace.result == 'skipped') && !(needs.build-workspace.result == 'skipped' && needs.build-single.result == 'skipped')}} runs-on: ubuntu-20.04 steps: @@ -139,6 +148,7 @@ jobs: # Add always() as otherwise the job is being skipped: https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions if: ${{ always() && needs.post-build.result == 'success' && fromJSON(needs.prepare-build.outputs.trigger_automatic_deployment) }} runs-on: ubuntu-20.04 + timeout-minutes: ${{ fromJSON(inputs.timeout) }} strategy: matrix: customer: ${{ fromJSON(needs.prepare-build.outputs.customers) }} diff --git a/.github/workflows/build-single-product-part.yml b/.github/workflows/build-single-product-part.yml index f329162a..8d390dec 100644 --- a/.github/workflows/build-single-product-part.yml +++ b/.github/workflows/build-single-product-part.yml @@ -44,6 +44,10 @@ on: description: "stage for the image (develop or production) depending on the branch name" required: true type: string + timeout: + description: "Timeout in minutes for each job" + type: string + default: 30 env: TIME_ZONE: "Europe/Vienna" NODE_VERSION: "16.16" @@ -60,6 +64,7 @@ permissions: jobs: build-components: runs-on: ubuntu-20.04 + timeout-minutes: ${{ fromJSON(inputs.timeout) }} steps: # checkout specific repository - uses: actions/checkout@v3 diff --git a/.github/workflows/build-workspace-product-part.yml b/.github/workflows/build-workspace-product-part.yml index bf0540f3..61e054a2 100644 --- a/.github/workflows/build-workspace-product-part.yml +++ b/.github/workflows/build-workspace-product-part.yml @@ -44,6 +44,10 @@ on: description: "stage for the image (develop or production) depending on the branch name" required: true type: string + timeout: + description: "Timeout in minutes for each job" + type: string + default: 30 env: VISYN_SCRIPTS_VERSION: "develop" TIME_ZONE: "Europe/Vienna" @@ -61,6 +65,7 @@ permissions: jobs: build-components: runs-on: ubuntu-20.04 + timeout-minutes: ${{ fromJSON(inputs.timeout) }} steps: # checkout specific repository - uses: actions/checkout@v3 @@ -191,20 +196,20 @@ jobs: product_version=$(jq -rc '.version' ./package.json) echo "product_version=$product_version" - if [[ $product_version == *"SNAPSHOT"* ]]; then + if [[ "$product_version" == *"SNAPSHOT"* ]]; then echo "replace SNAPSHOT in version with timestamp" - product_version=$(echo "$product_version" | sed "s/SNAPSHOT/$(date +%Y%m%d-%H%M%S)/g") + product_version=${product_version/SNAPSHOT/$(date +%Y%m%d-%H%M%S)} echo "product_version=$product_version" fi - workspace_version=$(jq -rc '.version' ./tmp/$COMPONENT/package.json) + workspace_version=$(jq -rc '.version' ./tmp/"$COMPONENT"/package.json) echo "workspace_version=$workspace_version" - if [[ $product_version != $workspace_version ]]; then + if [[ "$product_version" != "$workspace_version" ]]; then echo "update workspace version" - jq --arg version "$product_version" '.version = $version' ./tmp/$COMPONENT/package.json > ./tmp/$COMPONENT/package.json.tmp - mv ./tmp/$COMPONENT/package.json.tmp ./tmp/$COMPONENT/package.json - echo "workspace version updated to $(jq -rc '.version' ./tmp/$COMPONENT/package.json)" + jq --arg version "$product_version" '.version = $version' ./tmp/"$COMPONENT"/package.json > ./tmp/"$COMPONENT"/package.json.tmp + mv ./tmp/"$COMPONENT"/package.json.tmp ./tmp/"$COMPONENT"/package.json + echo "workspace version updated to $(jq -rc '.version' ./tmp/"$COMPONENT"/package.json)" fi env: COMPONENT: ${{ inputs.component }}