-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (50 loc) · 1.62 KB
/
ci-on-push.yaml
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
60
61
62
name: CI (push)
on:
push:
branches: ['**']
paths:
- .github/**
- ccHFM/**
workflow_dispatch:
repository_dispatch:
jobs:
commit-check:
name: Commit check
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 2 # to compute the differences
- name: Run static analysis tool
uses: ./.github/actions/pds-companion
with:
script: |
# fail on first error
set -Eeuo pipefail
# compute difference
readarray -d "" commit_files < <(git diff-tree -z --no-commit-id --name-only --diff-filter=AM -r --root HEAD -- ccHFM/)
if (( "${#commit_files[@]}" == 0 )) ; then
echo "No mod files to test."
exit
fi
echo "## Commit: fresh mod files ##"
printf " %q\n" "${commit_files[@]}"
# the static analysis tool uses these for finer analysis
scaffolding=(ccHFM/common/cb_types.txt)
# run static analysis
vic2-companion --color=always --heartbeat --whitelist --remarks=opinion "${scaffolding[@]}" "${commit_files[@]}"
branch-check:
name: Branch check
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Run static analysis tool
uses: ./.github/actions/pds-companion
with:
script: |
# fail on first error
set -Eeuo pipefail
# run static analysis
vic2-companion --color=always --heartbeat --whitelist ccHFM