From 973dda3ef83e663463d478d99efb003c3011f13f Mon Sep 17 00:00:00 2001 From: Guy Afik <53861351+GuyAfik@users.noreply.github.com> Date: Sun, 28 Jan 2024 14:20:56 +0200 Subject: [PATCH] [CI] - Add default timeouts to cancel hanging jobs (#3986) * Add default timeout * test * try github.ref_name * use ref_name * upgrade node to 20 as 16 is deprecated --------- Co-authored-by: Michael Yochpaz <8832013+MichaelYochpaz@users.noreply.github.com> --- .github/actions/setup_test_environment/action.yml | 2 +- .github/workflows/on-push.yml | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup_test_environment/action.yml b/.github/actions/setup_test_environment/action.yml index 03e342a9ad..37f39db577 100644 --- a/.github/actions/setup_test_environment/action.yml +++ b/.github/actions/setup_test_environment/action.yml @@ -10,7 +10,7 @@ inputs: node-version: required: false type: string - default: "16" + default: "20" description: "The node version to install" artifacts-dir: required: false diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index d524f5f72d..ea414b5d41 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -8,6 +8,7 @@ on: branches: - "**" + concurrency: group: tests-${{ github.head_ref || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} @@ -16,7 +17,7 @@ concurrency: jobs: validate-changelog: runs-on: ubuntu-latest - if: github.head_ref != 'master' + if: github.ref_name != 'master' steps: - name: Checkout uses: actions/checkout@v4 @@ -79,6 +80,7 @@ jobs: artifacts-dir: unit-tests/logs - name: Run Unit Tests + timeout-minutes: 60 run: | source "$(poetry env info --path)/bin/activate" @@ -123,6 +125,7 @@ jobs: artifacts-dir: integration-tests/logs - name: Run Integration Tests + timeout-minutes: 60 run: | source "$(poetry env info --path)/bin/activate" @@ -161,6 +164,7 @@ jobs: artifacts-dir: graph-tests/logs - name: Run Graph Tests + timeout-minutes: 60 run: | source "$(poetry env info --path)/bin/activate" @@ -238,6 +242,7 @@ jobs: cd content poetry run pip install git+https://github.com/demisto/demisto-sdk@${{ steps.get-commit.outputs.commit }} - name: Run content unit tests + timeout-minutes: 60 env: PYTHONPATH: ${{ github.workspace }}/content run: | @@ -281,6 +286,7 @@ jobs: echo -e "[validate]\nrun_specific_validations=BA101" > .demisto-sdk-conf - name: run pre-commit on changed files + timeout-minutes: 60 run: | source $(poetry env info --path)/bin/activate cd content @@ -296,6 +302,7 @@ jobs: demisto-sdk pre-commit --validate --show-diff-on-failure --verbose - name: run pre-commit on input files + timeout-minutes: 60 continue-on-error: true run: | source $(poetry env info --path)/bin/activate @@ -329,6 +336,7 @@ jobs: path: content - name: Run Graph + timeout-minutes: 60 run: | source $(poetry env info --path)/bin/activate cd content