Claude Mosaiq demo #2115
Workflow file for this run
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
name: MosaiqDbTests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
# ============================================================================= | |
TestMosaiqDb: | |
# if: false | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
services: | |
SQLServer: | |
image: mcr.microsoft.com/mssql/server:2017-latest | |
env: | |
ACCEPT_EULA: Y | |
SA_PASSWORD: sqlServerPassw0rd | |
ports: | |
- 1433:1433 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Get full Python version | |
id: full-python-version | |
shell: bash | |
run: | | |
echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") | |
# ----------------------------------------------------------------------------- | |
# Set up pip | |
- name: Get pip cache dir | |
id: pip-cache | |
run: | | |
python -m pip install -U pip # to ensure version > 20 to have cache dir | |
echo "::set-output name=dir::$(pip cache dir)" | |
- name: Pip Cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: pip-tests-ubuntu-${{ steps.full-python-version.outputs.version }} | |
# ----------------------------------------------------------------------------- | |
# Upgrade pip and setuptools, and install poetry | |
- name: Upgrade pip and setuptools | |
run: | | |
pip install --upgrade pip setuptools | |
- name: Install Poetry | |
uses: snok/install-poetry@v1.3.4 | |
with: | |
version: 1.7.1 | |
virtualenvs-create: true | |
# ----------------------------------------------------------------------------- | |
# Set up Poetry | |
- name: Configure poetry | |
run: | | |
poetry config virtualenvs.in-project true | |
- name: Poetry Cache | |
uses: actions/cache@v2 | |
id: poetry-cache | |
with: | |
path: .venv | |
key: venv-tests-ubuntu-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | |
# This is from <https://github.com/python-poetry/poetry/blob/639d5e057/.github/workflows/main.yml#L57-L60> | |
- name: Ensure cache is healthy | |
if: steps.poetry-cache.outputs.cache-hit == 'true' | |
shell: bash | |
run: | | |
timeout 10s poetry run pip --version || rm -rf .venv | |
# ----------------------------------------------------------------------------- | |
## Install with Tests Environment | |
- name: Install a tests environment | |
run: | | |
poetry install -E mosaiq -E tests -E dicom | |
# ----------------------------------------------------------------------------- | |
# PyMedPhys Data Cache | |
- name: Get PyMedPhys cache directory | |
id: pymedphys-cache-location | |
run: | | |
echo "::set-output name=dir::$(poetry run python -c 'import pymedphys._config as cf; print(str(cf.get_config_dir()))')" | |
- name: PyMedPhys Cache | |
id: pymedphys-cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.pymedphys-cache-location.outputs.dir }} | |
key: pymedphys-tests-ubuntu-${{ hashFiles('**/hashes.json') }} | |
# ----------------------------------------------------------------------------- | |
# TESTS | |
## Mosaiq_db tests -- only run on Ubuntu because needs container | |
- name: Run MSQ database tests | |
run: | | |
poetry run pymedphys dev tests -v --mosaiqdb |