-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (46 loc) · 1.38 KB
/
codecov.yaml
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
name: Run Tests
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
name: Test OneSilaHeadless
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: fake
POSTGRES_PASSWORD: fake
POSTGRES_DB: fake
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install requirements
run: pip install -r requirements.txt
- name: Run tests and collect coverage
env:
POSTGRES_HOST: localhost
POSTGRES_USER: fake
POSTGRES_PASSWORD: fake
POSTGRES_DB: fake
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
REDIS_HOST: localhost
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
run: cd OneSila && coverage run --source='.' manage.py test && coverage json
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}