harbor-ci #120
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: harbor-ci | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
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: | |
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.10"] | |
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 | |
# More info on options: https://github.com/mamba-org/provision-with-micromamba | |
- name: Setup Conda Environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: devtools/environment.yml | |
environment-name: harbor | |
cache-environment: true | |
cache-downloads: true | |
create-args: >- | |
python==${{ matrix.python-version }} | |
- 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: Install packages | |
run: | | |
python -m pip install -e ./ --no-deps | |
micromamba list | |
- 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=harbor \ | |
harbor/tests | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: choderalab/harbor |