Skip to content

Add interface contact probability scores #184

Add interface contact probability scores

Add interface contact probability scores #184

Workflow file for this run

name: CI
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"
- name: Run tests with coverage
env:
OPENBLAS_NUM_THREADS: "1"
OMP_NUM_THREADS: "1"
MKL_NUM_THREADS: "1"
NUMEXPR_NUM_THREADS: "1"
# Enable slow Connolly/SC reference checks — best regression guard for SC numerics
ALPHAJUDGE_RUN_SLOW_SC_REFERENCE: "1"
run: |
pytest test/ \
-n auto --timeout=900 \
--cov=src/alphajudge \
--cov-report=term \
--cov-report=xml:coverage.xml \
--cov-report=html:htmlcov \
--junitxml=junit.xml
- name: Upload coverage artifacts
if: matrix.python-version == '3.12'
uses: actions/upload-artifact@v4
with:
name: coverage-html
path: htmlcov
if-no-files-found: error
retention-days: 14
- name: Upload coverage XML
if: matrix.python-version == '3.12'
uses: actions/upload-artifact@v4
with:
name: coverage-xml
path: coverage.xml
if-no-files-found: error
retention-days: 14
coverage-pages:
needs: test
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Download coverage HTML
uses: actions/download-artifact@v4
with:
name: coverage-html
path: htmlcov
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: htmlcov
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
docker:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || (github.event_name == 'release' && github.event.action == 'published')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build test stage (no push) for PR
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
target: test
push: false
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Run tests by building test stage before push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
target: test
push: false
- name: Build and push :latest on push to main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
target: runtime
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/alphajudge:latest
- name: Build and push :<tag> on release
if: github.event_name == 'release' && github.event.action == 'published'
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
target: runtime
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/alphajudge:${{ (github.event_name == 'release' && github.event.action == 'published') && github.event.release.tag_name || 'latest' }}