-
Notifications
You must be signed in to change notification settings - Fork 27
50 lines (45 loc) · 1.35 KB
/
actions.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
name: main
on:
pull_request:
branches:
- master
jobs:
dependency-guard:
runs-on: ubuntu-latest
steps:
- uses: zendesk/checkout@v2
- name: Block dependencies from being added to package.json
run: |
IFS=' ' read -r allowed <<< "native-promise-only zendesk_app_framework_sdk"
dependencies=$(jq -r .dependencies package.json | jq 'keys' | jq .[] | sed 's/"//g')
for dep in "${dependencies[@]}"; do
if [[ ! ${allowed[*]} =~ (^|[[:space:]])"$dep"($|[[:space:]]) ]]; then
echo "::error ZAP SDK does not allow external dependencies, please remove \"${dep}\" dependency from package.json"
exit 1
fi
done
shell: bash
main-job:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- env:
TASK: lint
command: npm run lint
- env:
TASK: test
command: npm test
- env:
TASK: build
command: npm run build
steps:
- uses: zendesk/checkout@v2
- uses: zendesk/[email protected]
with:
node-version: 12.10.0
- name: install npm modules
run: |
npm install standardx
- name: ${{ matrix.env.TASK }}
run: TASK=${{ matrix.env.TASK }} ${{ matrix.command }}