-
Notifications
You must be signed in to change notification settings - Fork 39
51 lines (51 loc) · 1.59 KB
/
templates_ts.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
on:
push:
branches: [main, ifc2-foundations] # TODO ifc2-foundations only while that feature branch is active
pull_request:
branches: ['*']
workflow_dispatch: {}
concurrency:
cancel-in-progress: true
group: templates-compilation-${{ github.ref }}
name: iac-templates
jobs:
list-templates:
outputs:
to_test: ${{ steps.find_dirs.outputs.to_test }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: find templates
id: find_dirs
run: |
json="$(find pkg/infra/iac2/templates -type d -maxdepth 1 -mindepth 1 -exec basename {} \; \
| jq -csR 'split("\n") | map(select(. != ""))')"
echo "to_test=$json" > $GITHUB_OUTPUT
checks:
needs: [list-templates]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
template_dir: ${{ fromJson(needs.list-templates.outputs.to_test) }}
defaults:
run:
working-directory: pkg/infra/iac2/templates/${{ matrix.template_dir }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16
- name: check for unexpected files
run:
expected="factory.ts\npackage-lock.json\npackage.json"
echo "SHOWING EXPECTED / ACTUAL"
diff --side-by-side <(echo "$expected") <(ls -1)
- run: npm install typescript --no-save
- run: npm install
- run: npx tsc factory.ts
- name: install depcheck
run: npm install --no-save depcheck
- name: run depcheck
run: npx depcheck