Skip to content

Commit

Permalink
[CI] - Add default timeouts to cancel hanging jobs (#3986)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
GuyAfik and MichaelYochpaz committed Jan 28, 2024
1 parent b3a6f3e commit 973dda3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup_test_environment/action.yml
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/on-push.yml
Expand Up @@ -8,6 +8,7 @@ on:
branches:
- "**"


concurrency:
group: tests-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -329,6 +336,7 @@ jobs:
path: content

- name: Run Graph
timeout-minutes: 60
run: |
source $(poetry env info --path)/bin/activate
cd content
Expand Down

0 comments on commit 973dda3

Please sign in to comment.