-
Notifications
You must be signed in to change notification settings - Fork 98
47 lines (38 loc) · 1.48 KB
/
build.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
name: Build
on: [push, pull_request]
jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
fail-fast: false # Don't cancel entire run if one python-version fails
matrix:
python-version: ["3.7", "3.8", "3.9"]
name: Build and test on Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# cache: 'pip'
# cache-dependency-path: setup.py
- name: Install and upgrade latest CI dependencies
run: |
pip install --upgrade pip
pip install --upgrade pytest coverage # pytest-cov
pip install --upgrade importlib-metadata # Solves a python 3.7 install bug
- name: Install local causallib
run: |
pip install .
pip install .[contrib] # Optional requirements for contrib module
- name: Show environment's final dependencies
run: pip freeze --all
- name: Test with pytest
run: |
coverage run --source=. --omit=*__init__.py,setup.py -m pytest
coverage xml
# pytest tests.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
- name: Publish to CodeClimate
uses: paambaati/codeclimate-action@v5.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_REPORTER_ID }}