-
Notifications
You must be signed in to change notification settings - Fork 5
67 lines (61 loc) · 1.64 KB
/
test.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Tests
on:
workflow_dispatch:
push:
paths:
- '**.py'
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
environment: tests
env:
FFLOGSAPI_CID: ${{ secrets.FFLOGSAPI_CLIENT_ID }}
FFLOGSAPI_SECRET: ${{ secrets.FFLOGSAPI_CLIENT_SECRET }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install -e.[test]
- name: Run caching tests with pytest
run: |
pytest tests/client/test_caching.py
- name: Test with pytest
run: |
pytest
coverage:
runs-on: ubuntu-latest
environment: tests
env:
FFLOGSAPI_CID: ${{ secrets.FFLOGSAPI_CLIENT_ID }}
FFLOGSAPI_SECRET: ${{ secrets.FFLOGSAPI_CLIENT_SECRET }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install -e.[test]
- name: Test for code coverage
run: |
pytest --cov=fflogsapi
mv .coverage .coverage-core
- name: Test coverage of caching tests
run: |
pytest --cov=fflogsapi tests/client/test_caching.py
mv .coverage .coverage-caching
- name: Combine coverage reports
run: |
coverage combine .coverage-core .coverage-caching
coverage xml
- name: Upload coverage report to Codecov
uses: codecov/[email protected]