Skip to content

Commit

Permalink
Merge branch 'master' into pre-commit-continue-on-fetch-failure
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelYochpaz committed Jan 25, 2024
2 parents 29f1900 + 3ffd770 commit 0169feb
Show file tree
Hide file tree
Showing 42 changed files with 3,030 additions and 128 deletions.
4 changes: 0 additions & 4 deletions .changelog/3912.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .changelog/3961.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
changes:
- description: Log files will now be saved by default to `$HOME/.demisto-sdk/logs`. This behavior can be overridden by the `--log-file-path` flag, or the `DEMISTO_SDK_LOG_FILE_PATH` environment variable.
type: feature
- description: Log file path (can be set by the `--log-file-path` flag or the `DEMISTO_SDK_LOG_FILE_PATH` environment variable) can now only accept directory values. Setting it to a file path is no longer supported (file name is now constantly `demisto_sdk_debug.log` and cannot be changed). The path will now be automatically generated if it doesn't exist.
type: breaking
pr_number: 3912
4 changes: 4 additions & 0 deletions .changelog/3970.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- description: Fixed an issue in **upload** where customFields with explicitly defined values (e.g., ${}) caused the command to fail.
type: fix
pr_number: 3970
4 changes: 4 additions & 0 deletions .changelog/3971.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- description: Fixed an issue where validate command failed with Lists folder containing a data json file.
type: fix
pr_number: 3971
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Setup python environment for demisto-sdk jobs'
description: 'Setup python environment for demisto-sdk jobs'
name: 'Setup testing environment for demisto-sdk jobs'
description: 'Setup testing environment for demisto-sdk jobs - that includes adding python/create-artifacts/install dependencies'
author: 'Demisto-SDK'

inputs:
Expand All @@ -17,6 +17,11 @@ inputs:
type: string
default: "-E generate-unit-tests"
description: "the arguments for the poetry install command"
artifacts-dir:
required: false
type: string
default: $GITHUB_JOB
description: "The name of the artifacts dir"

runs:
using: 'composite'
Expand Down
15 changes: 13 additions & 2 deletions .github/actions/setup_test_environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,27 @@ inputs:
type: string
default: "16"
description: "The node version to install"
artifacts-dir:
required: false
type: string
default: "artifacts-dir"
description: "The name of the artifacts dir"


runs:
using: 'composite'
steps:
- name: Create Artifacts Dir
run: |
mkdir -p ${{ inputs.artifacts-dir }}
echo "Created directory ${{ inputs.artifacts-dir }} successfully"
shell: bash

- name: Python ${{ matrix.python-version }} - Setup Environment
uses: ./.github/actions/setup_poetry_python_environment
uses: ./.github/actions/setup_environment
with:
python-version: ${{ inputs.python-version }}
artifacts-dir: ${{ inputs.artifacts-dir }}

- name: Set up Node.js
uses: actions/setup-node@v3
Expand All @@ -31,5 +42,5 @@ runs:
- name: Install npm
run: |
npm install
echo $(echo '{"node_version": "'$(node --version)'","npm_list":'$(npm list --json)'}') > node_versions_info.json
echo $(echo '{"node_version": "'$(node --version)'","npm_list":'$(npm list --json)'}') > ${{ inputs.artifacts-dir }}/node_versions_info.json
shell: bash
41 changes: 23 additions & 18 deletions .github/actions/test_summary/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@ description: 'Uploads artifacts, prints out a summary and check if there are any
author: 'Demisto-SDK'

inputs:
python-version:
required: true
type: string
description: "The python version"
artifacts-folder-name:
required: false
type: string
description: "The folder name to save artifacts"
summary-display-options:
required: false
type: string
Expand All @@ -21,21 +13,34 @@ inputs:
type: "string"
description: "The junit-path file to post its summary in github workflow summary"
default: ""

artifacts-path-dir:
required: false
type: string
default: $GITHUB_JOB
description: "The path to the artifacts dir"
artifact-name:
required: false
type: string
default: $GITHUB_JOB
description: "The name of of the artifact to upload"


runs:
using: 'composite'
steps:
- name: Combine Artifacts
if: always()
run: |
# move logs files created and .coverage to artifacts folder
mv .coverage ${{ inputs.artifacts-path-dir }}/.coverage || true
mv demisto_sdk_debug*.log ${{ inputs.artifacts-path-dir }}/logs || true
shell: bash
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
uses: ./.github/actions/upload_artifacts
with:
name: ${{ inputs.artifacts-folder-name }}-artifacts-python-${{ inputs.python-version }}
path: |
${{ inputs.artifacts-folder-name }}
node_versions_info.json
.coverage
artifacts-path-dir: ${{ inputs.artifacts-path-dir }}
artifact-name: ${{ inputs.artifact-name }}
- name: Print Summary of pytest results in workflow summary
if: ${{ inputs.junit-path != '' }}
uses: pmeier/pytest-results-action@main
Expand All @@ -44,13 +49,13 @@ runs:
summary: true
display-options: ${{ inputs.summary-display-options }}
fail-on-empty: false
- name: Check if ${{ inputs.artifacts-folder-name }} have passed
- name: Check if tests have have passed
shell: bash
if: always()
run: |
if [[ "$PYTEST_EXIT_CODE" -ne 0 ]]; then
echo "There are ${{ inputs.artifacts-folder-name }} that failed, pytest finished with exit code $PYTEST_EXIT_CODE, to see the ${{ inputs.artifacts-folder-name }} summary refer to https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}?pr=${{ github.event.pull_request.number }}"
echo "There are tests that failed, pytest finished with exit code $PYTEST_EXIT_CODE, to see the tests summary refer to https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}?pr=${{ github.event.pull_request.number }}"
else
echo "All ${{ inputs.artifacts-folder-name }} have passed, congratulations!"
echo "All tests have passed, congratulations!"
fi
exit $PYTEST_EXIT_CODE
27 changes: 27 additions & 0 deletions .github/actions/upload_artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Upload artifacts to github summary'
description: 'Uploads artifacts to the github summary of a workflow'
author: 'Demisto-SDK'

inputs:
artifacts-path-dir:
required: true
type: string
description: "The path to the artifacts dir"

artifact-name:
required: false
type: string
default: $GITHUB_JOB
description: "The name of of the artifact to upload"


runs:
using: 'composite'
steps:
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: |
${{ inputs.artifacts-path-dir }}
2 changes: 1 addition & 1 deletion .github/workflows/close_jira_issue_by_pr_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
python-version: '3.9'
- name: Setup Poetry
uses: Gr1N/setup-poetry@v8
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/link_edited_pr_to_jira_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
python-version: '3.10'
- name: Setup Poetry
uses: Gr1N/setup-poetry@v8
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
Expand Down

0 comments on commit 0169feb

Please sign in to comment.