-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (47 loc) · 1.62 KB
/
ci.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python application
on: [push, pull_request]
jobs:
test:
name: Test
strategy:
max-parallel: 1
matrix:
pg-version: ['14']
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Install PostgreSQL
uses: harmon758/postgresql-action@v1
with:
postgresql version: ${{ matrix.pg-version }}
postgresql db: marketplace
postgresql user: marketplace
postgresql password: marketplace
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: '3.9.x'
- name: Initialize environment
run: |
pip install --upgrade pip poetry
poetry install
poetry run python contrib/gen_env.py
- name: Validate code syntax and unit tests
run: |
poetry run python contrib/code_check.py
poetry run coverage xml
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: annotations,path,test_changes
fail_ci_if_error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check coverage status
run: |
# Get the coverage of the last commit from the codecov API
poetry run python contrib/compare_coverage.py