forked from avinson/rom24-quickmud
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (67 loc) · 2.47 KB
/
ci.yml
File metadata and controls
70 lines (67 loc) · 2.47 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
63
64
65
66
67
68
69
70
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
check-latest: true
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install project
run: pip install -e .[dev] || pip install -e .
- name: Help data drift check
run: |
python -m mud.scripts.convert_help_are_to_json area/help.are data/help.json
# Fail CI if regeneration changes the tracked file
if ! git diff --exit-code -- data/help.json; then
echo "data/help.json is out of date with area/help.are. Run: python -m mud.scripts.convert_help_are_to_json area/help.are data/help.json" >&2
exit 1
fi
- name: Lint
run: |
ruff check mud/net mud/security \
tests/test_telnet_server.py tests/test_ansi.py \
tests/test_scripted_session.py tests/test_hash_utils.py
flake8 mud/net/ansi.py mud/net/protocol.py mud/security/hash_utils.py \
tests/test_telnet_server.py tests/test_ansi.py \
tests/test_scripted_session.py tests/test_hash_utils.py
- name: Test fixtures lint
run: |
python3 scripts/lint_test_fixtures.py
- name: Enforce rng_mm usage (no random in combat/affects)
run: |
if grep -R -n "\\brandom\\." mud/combat mud/affects; then
echo "Forbidden Python random.* usage found in combat/affects." >&2
exit 1
else
echo "OK: no random.* usage in combat/affects"
fi
- name: Type check
run: mypy mud/net/ansi.py mud/net/protocol.py mud/net/connection.py mud/security/hash_utils.py --follow-imports=skip
- name: Test
run: pytest --cov=mud --cov-report=term --cov-fail-under=80
telnet-tests:
name: Telnet Server Tests (Linux-only)
runs-on: ubuntu-latest
if: runner.os == 'Linux'
timeout-minutes: 5
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
check-latest: true
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install project
run: pip install -e .[dev] || pip install -e .
- name: Run telnet tests with timeout
env:
PYTHONUNBUFFERED: "1"
run: |
pytest -q -m telnet