|
| 1 | +name: Continuous Integration Workflow |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + pull_request: |
| 7 | + branches: |
| 8 | + - '*' |
| 9 | + |
| 10 | +jobs: |
| 11 | + |
| 12 | + run-tests: |
| 13 | + |
| 14 | + name: Run tests for ${{ matrix.os }} on ${{ matrix.python-version }} |
| 15 | + runs-on: ${{ matrix.os }} |
| 16 | + |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] |
| 21 | + python-version: ['3.6', '3.7', '3.8', '3.9'] |
| 22 | + |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v2 |
| 25 | + - uses: r-lib/actions/setup-tinytex@v1 |
| 26 | + if: runner.os != 'Windows' |
| 27 | + - uses: conda-incubator/setup-miniconda@v2 |
| 28 | + with: |
| 29 | + auto-update-conda: true |
| 30 | + python-version: ${{ matrix.python-version }} |
| 31 | + |
| 32 | + - name: Install MacOS dependencies. |
| 33 | + if: runner.os == 'macOS' |
| 34 | + shell: bash -l {0} |
| 35 | + run: brew install ghostscript |
| 36 | + |
| 37 | + - name: Install LaTeX dependencies. |
| 38 | + if: runner.os != 'Windows' |
| 39 | + shell: bash -l {0} |
| 40 | + run: tlmgr install import epstopdf biblatex biber |
| 41 | + |
| 42 | + - name: Install core dependencies. |
| 43 | + shell: bash -l {0} |
| 44 | + run: conda install -c conda-forge tox-conda coverage |
| 45 | + |
| 46 | + # Unit, integration, and end-to-end tests. |
| 47 | + |
| 48 | + - name: Run unit tests and doctests. |
| 49 | + shell: bash -l {0} |
| 50 | + run: tox -e pytest -- src tests -m "unit or (not integration and not end_to_end)" --cov=./ --cov-report=xml -n auto |
| 51 | + |
| 52 | + - name: Upload coverage report for unit tests and doctests. |
| 53 | + if: runner.os == 'Linux' && matrix.python-version == '3.8' |
| 54 | + shell: bash -l {0} |
| 55 | + run: bash <(curl -s https://codecov.io/bash) -F unit -c |
| 56 | + |
| 57 | + # - name: Run integration tests. |
| 58 | + # shell: bash -l {0} |
| 59 | + # run: tox -e pytest -- src tests -m integration --cov=./ --cov-report=xml -n auto |
| 60 | + |
| 61 | + # - name: Upload coverage reports of integration tests. |
| 62 | + # if: runner.os == 'Linux' && matrix.python-version == '3.8' |
| 63 | + # shell: bash -l {0} |
| 64 | + # run: bash <(curl -s https://codecov.io/bash) -F integration -c |
| 65 | + |
| 66 | + - name: Run end-to-end tests. |
| 67 | + shell: bash -l {0} |
| 68 | + run: tox -e pytest -- src tests -m end_to_end --cov=./ --cov-report=xml -n auto |
| 69 | + |
| 70 | + - name: Upload coverage reports of end-to-end tests. |
| 71 | + if: runner.os == 'Linux' && matrix.python-version == '3.8' |
| 72 | + shell: bash -l {0} |
| 73 | + run: bash <(curl -s https://codecov.io/bash) -F end_to_end -c |
0 commit comments