-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (45 loc) · 1.42 KB
/
Copy pathtest.yml
File metadata and controls
51 lines (45 loc) · 1.42 KB
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
name: tests
on:
push:
branches: [main]
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python: ["3.9", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Compile scripts (syntax)
run: python -m py_compile scripts/scan.py scripts/query.py scripts/apply_audit.py scripts/render.py
- name: Unit + golden tests
run: python -m unittest discover -s tests -v
- name: Render the sample project (smoke)
run: >
python scripts/render.py
--state examples/sample-project/modules.json
--template assets/template.html
--out-html /tmp/codemap.html --out-md /tmp/codemap.md
shell: bash
template-js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: Syntax-check the template's inline JS
run: |
python - <<'PY'
import re
html = open("assets/template.html", encoding="utf-8").read()
m = re.search(r"<script>(.*)</script>", html, re.S)
open("/tmp/_t.js", "w", encoding="utf-8").write(m.group(1).replace("__ARCH_DATA__", "{}"))
PY
node --check /tmp/_t.js