|
| 1 | +name: run-tests |
| 2 | +on: |
| 3 | + # test cron by running it once a day at 01:00 |
| 4 | + schedule: |
| 5 | + - cron: '0 1 * * *' |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - master |
| 9 | + - dev |
| 10 | + pull_request: |
| 11 | + branches: |
| 12 | + - master |
| 13 | +jobs: |
| 14 | + tests: |
| 15 | + runs-on: ${{ matrix.os }} |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 19 | + python-version: [3.6, 3.7, 3.8, 3.9] |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v2 |
| 22 | + - name: Setup Python ${{ matrix.python-version }} |
| 23 | + uses: actions/setup-python@v2 |
| 24 | + with: |
| 25 | + python-version: ${{ matrix.python-version }} |
| 26 | + - name: Display Python version |
| 27 | + run: python -c "import sys; print(sys.version)" |
| 28 | + - name: Install dependencies |
| 29 | + run: | |
| 30 | + python setup.py install |
| 31 | + pip install -r requirements-test.txt |
| 32 | + - name: Run tests |
| 33 | + run: pytest |
| 34 | + run-coverall: |
| 35 | + runs-on: [ubuntu-latest] |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v2 |
| 38 | + - name: Setup Python 3.8 |
| 39 | + uses: actions/setup-python@v2 |
| 40 | + with: |
| 41 | + python-version: "3.8" |
| 42 | + - name: Display Python version |
| 43 | + run: python -c "import sys; print(sys.version)" |
| 44 | + - name: Install dependencies |
| 45 | + run: | |
| 46 | + python setup.py install |
| 47 | + pip install -r requirements-test.txt |
| 48 | + pip install pytest coveralls |
| 49 | + - name: Create coverage |
| 50 | + run: | |
| 51 | + coverage run --source=odml -m pytest test/ |
| 52 | + - name: Submit to coveralls |
| 53 | + env: |
| 54 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 55 | + run: coveralls --service=github |
0 commit comments