Nursing Citizen Development
fix(ci): Import nursesim_rl to trigger environment registration in tests
0172277
name: CI - NurseSim-RL
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test-environment:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov flake8
- name: Lint with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test environment registration
run: |
python -c "import gymnasium as gym; import nursesim_rl; env = gym.make('NurseSim-Triage-v0'); print('✅ Environment registered successfully')"
- name: Run environment test
run: |
python test_env.py
- name: Validate dataset generation
run: |
python generate_dataset.py --num_scenarios 10 --output_file data/test_dataset.json
echo "✅ Dataset generation successful"
- name: Test A2A Protocol Compliance
run: |
python tests/test_a2a_compliance.py
- name: Test Dual-Mode Configuration
run: |
chmod +x tests/test_dual_mode.sh
chmod +x run.sh
bash tests/test_dual_mode.sh
- name: Validate Agent Card Schema
run: |
python -c "
import json
from pathlib import Path
card = json.loads(Path('.well-known/agent-card.json').read_text())
assert card['protocol'] == 'a2a/v1.0', 'Invalid protocol version'
assert 'capabilities' in card, 'Missing capabilities'
print('✅ Agent card schema valid')
"