-
Notifications
You must be signed in to change notification settings - Fork 56
59 lines (57 loc) · 1.76 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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