Uplift "Cortex XDR by Palo Alto Networks" Pack to Golden Standard. #6137
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint and Unit Tests | |
on: | |
pull_request: {} | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Read .nvmrc | |
run: echo ::set-output name=NVMRC::$(cat .nvmrc) # see: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions#set-an-output-parameter-set-output | |
id: nvm | |
- name: Set up node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "${{ steps.nvm.outputs.NVMRC }}" | |
- name: Cache npm | |
uses: actions/cache@v1 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Cache pip | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/Pipfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- run: npm ci | |
- uses: actions/setup-python@v1 | |
with: | |
python-version: '3.9' | |
- name: Setup pipenv | |
run: | | |
pip install pipenv | |
pipenv install --dev | |
- name: Fetch Dependent Files (content repo) | |
run: | | |
cd content-repo | |
wget https://raw.githubusercontent.com/demisto/content/master/Packs/Base/Scripts/CommonServerPython/CommonServerPython.py | |
wget https://raw.githubusercontent.com/demisto/content/master/Tests/demistomock/demistomock.py | |
sed -i -e '/from DemistoClassApiModule import */d' CommonServerPython.py | |
- name: Lint | |
run: | | |
cd content-repo | |
pipenv run mypy | |
pipenv run flake8 *.py | |
- name: Unit Testing | |
run: | | |
cd content-repo | |
pipenv run pytest -v |