Refactor steering code #489
Workflow file for this run
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
| # Copyright (c) Microsoft Corporation. | |
| # Licensed under the MIT License. | |
| name: ci | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| linux: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13'] | |
| name: Linux py ${{ matrix.python-version }} tests | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.x' | |
| - name: Install dependencies | |
| run: | | |
| uv sync --python ${{ matrix.python-version }} --extra dev | |
| # openmm (md extra) only supports up to Python 3.12 | |
| if uv run python -c "import sys; sys.exit(0 if sys.version_info < (3, 13) else 1)"; then | |
| uv sync --extra dev --extra md | |
| fi | |
| - name: Check style | |
| run: uv run pre-commit run --all-files | |
| - name: Run tests | |
| env: | |
| JAX_PLATFORMS: cpu | |
| run: | | |
| IGNORE_FLAGS="--ignore=tests/test_colabfold_inline/test_regression.py" | |
| # openmm not available on Python 3.13+ | |
| if ! uv run python -c "import openmm" 2>/dev/null; then | |
| IGNORE_FLAGS="$IGNORE_FLAGS --ignore=tests/test_mdrelax.py" | |
| fi | |
| uv run coverage run --source=bioemu -m pytest tests/ --durations=20 $IGNORE_FLAGS | |
| uv run coverage xml | |
| uv run coverage html | |
| - name: Upload code coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: code-coverage-html-py${{ matrix.python-version }} | |
| path: htmlcov | |
| - name: Create code coverage markdown report | |
| run: | | |
| dotnet tool install -g dotnet-reportgenerator-globaltool | |
| reportgenerator -reports:coverage.xml -targetdir:coveragereport -reporttypes:'MarkdownSummaryGithub' | |
| - name: Write to job summary | |
| run: cat coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY | |
| - name: Add comment to PR | |
| if: github.event_name == 'pull_request' && matrix.python-version == '3.12' | |
| run: gh pr comment $PR_NUMBER --body-file coveragereport/SummaryGithub.md | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PR_NUMBER: ${{ github.event.number }} | |
| continue-on-error: true |