|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main, "release/*", "dev"] |
| 8 | + |
| 9 | +jobs: |
| 10 | + run_tests_ubuntu: |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + os: ["ubuntu-latest"] |
| 17 | + python-version: ["3.8", "3.9", "3.10"] |
| 18 | + |
| 19 | + timeout-minutes: 20 |
| 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 env create -f environment.yml |
| 33 | + python -m pip install --upgrade pip |
| 34 | + pip install pytest |
| 35 | + pip install sh |
| 36 | +
|
| 37 | + - name: List dependencies |
| 38 | + run: | |
| 39 | + python -m pip list |
| 40 | +
|
| 41 | + - name: Run pytest |
| 42 | + run: | |
| 43 | + pytest -v |
| 44 | +
|
| 45 | + run_tests_macos: |
| 46 | + runs-on: ${{ matrix.os }} |
| 47 | + |
| 48 | + strategy: |
| 49 | + fail-fast: false |
| 50 | + matrix: |
| 51 | + os: ["macos-latest"] |
| 52 | + python-version: ["3.8", "3.9", "3.10"] |
| 53 | + |
| 54 | + timeout-minutes: 20 |
| 55 | + |
| 56 | + steps: |
| 57 | + - name: Checkout |
| 58 | + uses: actions/checkout@v3 |
| 59 | + |
| 60 | + - name: Set up Python ${{ matrix.python-version }} |
| 61 | + uses: actions/setup-python@v3 |
| 62 | + with: |
| 63 | + python-version: ${{ matrix.python-version }} |
| 64 | + |
| 65 | + - name: Install dependencies |
| 66 | + run: | |
| 67 | + conda env create -f environment.yml |
| 68 | + python -m pip install --upgrade pip |
| 69 | + pip install pytest |
| 70 | + pip install sh |
| 71 | +
|
| 72 | + - name: List dependencies |
| 73 | + run: | |
| 74 | + python -m pip list |
| 75 | +
|
| 76 | + - name: Run pytest |
| 77 | + run: | |
| 78 | + pytest -v |
| 79 | +
|
| 80 | + run_tests_windows: |
| 81 | + runs-on: ${{ matrix.os }} |
| 82 | + |
| 83 | + strategy: |
| 84 | + fail-fast: false |
| 85 | + matrix: |
| 86 | + os: ["windows-latest"] |
| 87 | + python-version: ["3.8", "3.9", "3.10"] |
| 88 | + |
| 89 | + timeout-minutes: 20 |
| 90 | + |
| 91 | + steps: |
| 92 | + - name: Checkout |
| 93 | + uses: actions/checkout@v3 |
| 94 | + |
| 95 | + - name: Set up Python ${{ matrix.python-version }} |
| 96 | + uses: actions/setup-python@v3 |
| 97 | + with: |
| 98 | + python-version: ${{ matrix.python-version }} |
| 99 | + |
| 100 | + - name: Install dependencies |
| 101 | + run: | |
| 102 | + conda env create -f environment.yml |
| 103 | + python -m pip install --upgrade pip |
| 104 | + pip install pytest |
| 105 | +
|
| 106 | + - name: List dependencies |
| 107 | + run: | |
| 108 | + python -m pip list |
| 109 | +
|
| 110 | + - name: Run pytest |
| 111 | + run: | |
| 112 | + pytest -v |
| 113 | +
|
| 114 | + # upload code coverage report |
| 115 | + code-coverage: |
| 116 | + runs-on: ubuntu-latest |
| 117 | + |
| 118 | + steps: |
| 119 | + - name: Checkout |
| 120 | + uses: actions/checkout@v2 |
| 121 | + |
| 122 | + - name: Set up Python 3.10 |
| 123 | + uses: actions/setup-python@v2 |
| 124 | + with: |
| 125 | + python-version: "3.10" |
| 126 | + |
| 127 | + - name: Install dependencies |
| 128 | + run: | |
| 129 | + conda env create -f environment.yml |
| 130 | + python -m pip install --upgrade pip |
| 131 | + pip install pytest |
| 132 | + pip install pytest-cov[toml] |
| 133 | + pip install sh |
| 134 | +
|
| 135 | + - name: Run tests and collect coverage |
| 136 | + run: pytest --cov flowdock # NEEDS TO BE UPDATED WHEN CHANGING THE NAME OF "src" FOLDER |
| 137 | + |
| 138 | + - name: Upload coverage to Codecov |
| 139 | + uses: codecov/codecov-action@v3 |
0 commit comments