-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (37 loc) · 1.07 KB
/
pr-checks.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
name: "Pull Request Tests"
on:
pull_request:
jobs:
unit-test-pr:
runs-on: ubuntu-latest
container: python:3.9
services:
redis:
image: redis:6.2-alpine
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install dependencies
working-directory: ./Commander
run: python -m pip install -r requirements.txt
- name: Run tests
working-directory: ./Commander
run: pytest --cov --cov-report=xml
env:
REDIS_URI: redis://redis:6379
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ./Commander/coverage.xml