-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.67 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
57
58
59
60
61
---
name: CI
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
id: setup-python
with:
python-version-file: '.python-version'
- name: Cache dependencies
uses: actions/cache@v3
id: cache-dependencies
with:
path: |
venv
key: ${{ runner.os }}-venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/*requirements.txt') }}
- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
python -m venv venv
. venv/bin/activate
pip install --upgrade pip pip-tools
pip-sync requirements.txt dev-requirements.txt
- name: Run linter
run: |
. venv/bin/activate
make lint
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2.0.0
id: cpu-cores
- name: Run tests
run: |
. venv/bin/activate
make test -e SIMULTANEOUS_TEST_JOBS=${{ steps.cpu-cores.outputs.count }}
- name: Get coverage XML file
run: |
. venv/bin/activate
make coverage -e SIMULTANEOUS_TEST_JOBS=${{ steps.cpu-cores.outputs.count }}
- name: Publish code coverage
uses: paambaati/codeclimate-action@v5.0.0
env:
CC_TEST_REPORTER_ID: 8ee335a0583342279062324a7dfebaf7a0543c508b2f31183587c2bc8300cb55
with:
coverageLocations: |
${{github.workspace}}/coverage.xml:coverage.py