Add non-technical documentation to PRIMO website (#34) #1
This file contains 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
# This workflow will ensure the demo is running successfully and serves as an integration test | |
name: Demo | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
types: | |
- opened | |
# ready_for_review occurs when a draft PR is turned to non-draft | |
- ready_for_review | |
# synchronize occurs whenever commits are pushed to the PR branch | |
- synchronize | |
jobs: | |
pytest: | |
name: Demo test (py${{ matrix.python-version }}/${{ matrix.os }}/${{ matrix.install-mode }}) | |
runs-on: ${{ matrix.os-version }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- '3.9' | |
- '3.10' | |
- '3.11' | |
os: | |
- linux | |
install-mode: | |
- dev | |
include: | |
- os: linux | |
os-version: ubuntu-latest | |
- install-mode: dev | |
python-version: '3.9' | |
os: linux | |
cov-report: true | |
steps: | |
- uses: actions/checkout@v4 | |
if: matrix.install-mode == 'dev' | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: primo | |
environment-file: conda-env-dev.yml | |
python-version: ${{ matrix.python-version }} | |
auto-activate-base: false | |
- name: Add pytest options to enable coverage report | |
if: matrix.cov-report | |
run: echo PYTEST_ADDOPTS="$PYTEST_ADDOPTS --cov --cov-report=xml:scip.xml" >> $GITHUB_ENV | |
- name: Run tests that rely on SCIP solver | |
shell: bash -el {0} | |
run: | | |
pytest -v -m "scip" | |
- name: Upload coverage report as job artifact | |
if: matrix.cov-report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: scip-coverage-report | |
path: scip.xml | |
if-no-files-found: error | |
upload-codecov: | |
name: Upload coverage to Codecov | |
needs: [pytest] | |
runs-on: ubuntu-latest | |
steps: | |
# the checkout step is needed to have access to codecov.yml | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: scip-coverage-report | |
- name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
file: ./scip.xml | |
verbose: true | |
# NOTE: secrets are not available for pull_request workflows | |
# However, as of 2024-02-10, Codecov is still allowing tokenless upload from PRs | |
# but does require token for other workflows e.g. merge to `main` | |
# see https://github.com/codecov/codecov-action/issues/1274#issuecomment-1934437359 | |
token: ${{ secrets.CODECOV_TOKEN }} |