Repository navigation
62 lines (59 loc) · 1.86 KB
/
Copy pathtests.yml
File metadata and controls
62 lines (59 loc) · 1.86 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
52
53
54
55
56
57
58
59
60
61
62
name: tests
on:
push:
pull_request:
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install -r requirements-dev.txt
- name: ruff
run: ruff check .
- name: mypy (pure helpers)
run: mypy
self-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
python: ["3.10", "3.12"]
env:
PYTHONIOENCODING: utf-8
HAWK_SKIP_LIVE_HW: "1"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- run: pip install -r requirements-dev.txt
- name: self-tests (pytest + coverage)
if: always()
run: |
coverage run -m pytest
coverage report -m
- name: install the package (pip install .)
if: always()
run: pip install .
- name: "smoke (installed hawk: init, dry-run poll, dashboard endpoints)"
if: always()
shell: bash
run: |
export COORD_HOME="$RUNNER_TEMP/hawk-home"
mkdir -p "$COORD_HOME"
cd "$RUNNER_TEMP" # run the installed package, not the checkout
hawk --version
hawk init
test -f "$COORD_HOME/config.json"
hawk poll --dry-run
hawk dashboard --port 8799 > "$RUNNER_TEMP/dash.log" 2>&1 &
for i in $(seq 1 30); do curl -sf -o /dev/null http://127.0.0.1:8799/ && break; sleep 1; done
for path in / /api/state /api/timeline; do
code=$(curl -s -o /dev/null -w "%{http_code}" --max-time 15 "http://127.0.0.1:8799$path")
echo "$path -> $code"
[ "$code" = "200" ] || { cat "$RUNNER_TEMP/dash.log"; exit 1; }
done