Skip to content

Commit 71f07d9

Browse files
committed
Separate coverage job from the testing
1 parent 19291ed commit 71f07d9

File tree

1 file changed

+36
-5
lines changed

1 file changed

+36
-5
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,23 @@ jobs:
3838
with:
3939
path: ~/.cache/pip
4040
# Cache based on OS, Python version, and dependency hash
41-
key: test-${{ runner.os }}-python${{ matrix.python-version }}-${{ hashFiles('requirements-test.txt') }}
41+
key: pip-test-${{ runner.os }}-python${{ matrix.python-version }}-${{ hashFiles('requirements-test.txt') }}
4242

4343
- name: Cache dependencies (macOS)
4444
if: startsWith(runner.os, 'macOS')
4545
uses: actions/cache@v2
4646
with:
4747
path: ~/Library/Caches/pip
4848
# Cache based on OS, Python version, and dependency hash
49-
key: test-${{ runner.os }}-python${{ matrix.python-version }}-${{ hashFiles('requirements-test.txt') }}
49+
key: pip-test-${{ runner.os }}-python${{ matrix.python-version }}-${{ hashFiles('requirements-test.txt') }}
5050

5151
- name: Cache dependencies (Windows)
5252
if: startsWith(runner.os, 'Windows')
5353
uses: actions/cache@v2
5454
with:
5555
path: ~\AppData\Local\pip\Cache
5656
# Cache based on OS, Python version, and dependency hash
57-
key: pip-${{ runner.os }}-python${{ matrix.python-version }}-${{ hashFiles('requirements-test.txt') }}
57+
key: pip-test-${{ runner.os }}-python${{ matrix.python-version }}-${{ hashFiles('requirements-test.txt') }}
5858

5959
- name: Install dependencies
6060
run: |
@@ -67,15 +67,46 @@ jobs:
6767
shell: bash
6868
env:
6969
TMPDIR: "${{ matrix.os == 'windows-latest' && 'D:\\a\\_temp' || '' }}"
70+
71+
coverage:
72+
name: coverage
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/checkout@v2
76+
77+
- name: Set up Python 3.8
78+
uses: actions/setup-python@v2
79+
with:
80+
python-version: "3.8"
81+
82+
- name: Cache dependencies
83+
uses: actions/cache@v2
84+
with:
85+
path: ~/.cache/pip
86+
# Cache based on OS, Python version, and dependency hash
87+
key: pip-test-${{ runner.os }}-python3.8-${{ hashFiles('requirements-test.txt') }}
88+
89+
- name: Install dependencies
90+
run: |
91+
pip install --upgrade pip
92+
pip install -r requirements-test.txt
93+
pip install -e ".[validation]"
94+
95+
- name: Execute test suite
96+
# --fail-under=0 ensures we publish the coverage regardless of whether it meets
97+
# the minimum so we can use Codecov to evaluate gaps
98+
run: |
99+
coverage run --source=pystac/ -m unittest discover tests/
100+
coverage xml --fail-under=0
70101
71102
- name: Upload All coverage to Codecov
72103
uses: codecov/codecov-action@v1
73-
# Only upload this once...
74-
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'}}
104+
if: ${{ env.GITHUB_REPOSITORY }} == 'stac-utils/pystac'
75105
with:
76106
token: ${{ secrets.CODECOV_TOKEN }}
77107
file: ./coverage.xml
78108
fail_ci_if_error: false
109+
79110
lint:
80111
runs-on: ubuntu-latest
81112
strategy:

0 commit comments

Comments
 (0)