modeling-ci #651
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: modeling-ci | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| pull_request: | |
| branches: | |
| - "main" | |
| - "pydantic_2" | |
| - "add-split-model" | |
| schedule: | |
| # Nightly tests run on main by default: | |
| # Scheduled workflows run on the latest commit on the default or base branch. | |
| # (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule) | |
| - cron: "0 0 * * *" | |
| workflow_dispatch: | |
| merge_group: | |
| concurrency: | |
| group: "${{ github.workflow }}-${{ github.ref }}" | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| jobs: | |
| test: | |
| name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| python-version: ["3.11"] | |
| env: | |
| OE_LICENSE: ${{ github.workspace }}/oe_license.txt | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| - name: Get Info About Runner | |
| run: | | |
| uname -a | |
| df -h | |
| ulimit -a | |
| - name: Get current date | |
| id: date | |
| run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}" | |
| # More info on options: https://github.com/mamba-org/provision-with-micromamba | |
| - name: Setup Conda Environment | |
| uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| micromamba-version: latest | |
| environment-file: devtools/conda-envs/${{ matrix.os }}/modeling.yaml | |
| environment-name: modeling | |
| cache-environment: true | |
| cache-downloads: true | |
| cache-environment-key: environment-${{ steps.date.outputs.date }} | |
| cache-downloads-key: downloads-${{ steps.date.outputs.date }} | |
| create-args: >- | |
| python==${{ matrix.python-version }} | |
| - name: Install packages | |
| run: | | |
| micromamba install -n modeling --file devtools/conda-envs/${{ matrix.os }}/data.yaml | |
| python -m pip install -e ./drugforge-data --no-deps | |
| python -m pip install -e ./drugforge-modeling --no-deps | |
| micromamba list | |
| - name: Test OE License & Write License to File | |
| env: | |
| OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }} | |
| run: | | |
| echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE} | |
| python -c "import openeye; assert openeye.oechem.OEChemIsLicensed(), 'OpenEye license checks failed!'" | |
| - name: Run tests | |
| env: | |
| CDDTOKEN: ${{ secrets.ASAP_CDD_VAULT_TOKEN_READ_ONLY }} | |
| MOONSHOT_CDD_VAULT_NUMBER: ${{ secrets.MOONSHOT_CDD_VAULT_NUMBER }} | |
| run: | | |
| # run each package test suite; append to coverage file | |
| # Exit immediately if a command exits with a non-zero status. | |
| set -e | |
| pytest -n auto --durations=10 -v --cov-report=xml --cov-report=term --color=yes \ | |
| --cov=drugforge-modeling \ | |
| drugforge-modeling/drugforge/modeling/tests | |
| - name: Upload Code Coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| # Don't upload coverage scheduled or on fork | |
| if: ${{ github.repository == 'choderalab/drugforge' | |
| && github.event != 'schedule' }} | |
| with: | |
| file: ./coverage.xml | |
| flags: unittests | |
| name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} | |
| fail_ci_if_error: false |