-
Notifications
You must be signed in to change notification settings - Fork 46
51 lines (50 loc) · 1.72 KB
/
unit_tests_with_latest_deps.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main
name: Unit Tests - Latest Dependencies
jobs:
unit_tests:
name: Unit Tests / Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Build source distribution
run: make package
- name: Install package with test requirements
run: |
python -m pip config --site set global.progress_bar off
python -m pip install --upgrade pip
python -m pip install unpacked_sdist/[test]
- if: ${{ matrix.python-version == 3.8 }}
name: Run unit tests with code coverage
run: |
coverage erase
cd unpacked_sdist/
pytest composeml/ -n auto --cov=composeml --cov-config=../pyproject.toml --cov-report=xml:../coverage.xml
- if: ${{ matrix.python-version != 3.8 }}
name: Run unit tests with no code coverage
run: |
cd unpacked_sdist/
pytest composeml/ -n auto
- if: ${{ matrix.python-version == 3.8 }}
name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: ${{ github.workspace }}/coverage.xml
verbose: true