|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main, "release/*"] |
| 8 | + |
| 9 | +jobs: |
| 10 | + run_tests: |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + os: ["ubuntu-latest", "macos-latest"] |
| 17 | + python-version: ["3.7", "3.8", "3.9", "3.10"] |
| 18 | + |
| 19 | + timeout-minutes: 10 |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Checkout |
| 23 | + uses: actions/checkout@v3 |
| 24 | + |
| 25 | + - name: Set up Python ${{ matrix.python-version }} |
| 26 | + uses: actions/setup-python@v3 |
| 27 | + with: |
| 28 | + python-version: ${{ matrix.python-version }} |
| 29 | + |
| 30 | + - name: Install dependencies |
| 31 | + run: | |
| 32 | + conda install -y -c conda-forge mamba |
| 33 | + mamba env create -f environment.yaml |
| 34 | + conda activate bio-diffusion |
| 35 | + python -m pip install --upgrade pip |
| 36 | + pip install -e . |
| 37 | + pip install pytest |
| 38 | + pip install sh |
| 39 | +
|
| 40 | + - name: List dependencies |
| 41 | + run: | |
| 42 | + python -m pip list |
| 43 | +
|
| 44 | + - name: Run pytest |
| 45 | + run: | |
| 46 | + pytest -v |
| 47 | +
|
| 48 | + run_tests_windows: |
| 49 | + runs-on: ${{ matrix.os }} |
| 50 | + |
| 51 | + strategy: |
| 52 | + fail-fast: false |
| 53 | + matrix: |
| 54 | + os: ["windows-latest"] |
| 55 | + python-version: ["3.7", "3.8", "3.9", "3.10"] |
| 56 | + |
| 57 | + timeout-minutes: 10 |
| 58 | + |
| 59 | + steps: |
| 60 | + - name: Checkout |
| 61 | + uses: actions/checkout@v3 |
| 62 | + |
| 63 | + - name: Set up Python ${{ matrix.python-version }} |
| 64 | + uses: actions/setup-python@v3 |
| 65 | + with: |
| 66 | + python-version: ${{ matrix.python-version }} |
| 67 | + |
| 68 | + - name: Install dependencies |
| 69 | + run: | |
| 70 | + conda install -y -c conda-forge mamba |
| 71 | + mamba env create -f environment.yaml |
| 72 | + conda activate bio-diffusion |
| 73 | + python -m pip install --upgrade pip |
| 74 | + pip install -e . |
| 75 | + pip install pytest |
| 76 | +
|
| 77 | + - name: List dependencies |
| 78 | + run: | |
| 79 | + python -m pip list |
| 80 | +
|
| 81 | + - name: Run pytest |
| 82 | + run: | |
| 83 | + pytest -v |
| 84 | +
|
| 85 | + # upload code coverage report |
| 86 | + code-coverage: |
| 87 | + runs-on: ubuntu-latest |
| 88 | + |
| 89 | + steps: |
| 90 | + - name: Checkout |
| 91 | + uses: actions/checkout@v2 |
| 92 | + |
| 93 | + - name: Set up Python 3.10 |
| 94 | + uses: actions/setup-python@v2 |
| 95 | + with: |
| 96 | + python-version: "3.10" |
| 97 | + |
| 98 | + - name: Install dependencies |
| 99 | + run: | |
| 100 | + conda install -y -c conda-forge mamba |
| 101 | + mamba env create -f environment.yaml |
| 102 | + conda activate bio-diffusion |
| 103 | + python -m pip install --upgrade pip |
| 104 | + pip install -e . |
| 105 | + pip install pytest |
| 106 | + pip install pytest-cov[toml] |
| 107 | + pip install sh |
| 108 | +
|
| 109 | + - name: Run tests and collect coverage |
| 110 | + run: pytest --cov src # NEEDS TO BE UPDATED WHEN CHANGING THE NAME OF "src" FOLDER |
| 111 | + |
| 112 | + - name: Upload coverage to Codecov |
| 113 | + uses: codecov/codecov-action@v3 |
0 commit comments