Update README.md #59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: UET Tests | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.10", "3.11", "3.12"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install numpy scipy matplotlib pandas | ||
| pip install -e ./uet_min_pack | ||
| - name: Test import | ||
| run: | | ||
| python -c "from uet_min_pack.uet_core import solver, energy, potentials; print('Import OK')" | ||
| - name: Run quick simulation test | ||
| run: | | ||
| python scripts/run_with_snapshots.py \ | ||
| --case-id ci_test \ | ||
| --model C_I \ | ||
| --beta 0.5 \ | ||
| --s 0.3 \ | ||
| --N 16 \ | ||
| --T 1 \ | ||
| --out runs_ci | ||
| - name: Verify simulation output | ||
| run: | | ||
| test -f runs_ci/ci_test/summary.json | ||
| python -c " | ||
| import json | ||
| with open('runs_ci/ci_test/summary.json') as f: | ||
| d = json.load(f) | ||
| assert d['status'] == 'PASS', f'Expected PASS, got {d[\"status\"]}' | ||
| print('✅ CI test passed!') | ||
| print(f' Omega: {d[\"Omega0\"]:.4f} -> {d[\"OmegaT\"]:.4f}') | ||
| print(f' Steps: {d[\"steps_accepted\"]}') | ||
| " | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
| - name: Install linters | ||
| run: pip install flake8 | ||
| - name: Run flake8 | ||
| run: | | ||
| flake8 uet_min_pack/uet_core --max-line-length=120 --ignore=E501,W503 | ||
| continue-on-error: true | ||