-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (76 loc) · 2.54 KB
/
unitest.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Workflow based on https://github.com/actions/starter-workflows/blob/main/ci/python-package.yml
name: Unit tests
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 9 * * 1,3,5"
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.python-version }}; rpy2 ${{ matrix.config.rpy2 }})
strategy:
fail-fast: false
matrix:
config:
- {os: 'ubuntu-20.04', python-version: '3.6', rpy2: 'true'}
- {os: 'ubuntu-20.04', python-version: '3.7', rpy2: 'true'}
- {os: 'ubuntu-latest', python-version: '3.8', rpy2: 'true'}
- {os: 'ubuntu-latest', python-version: '3.8', rpy2: 'false'}
- {os: 'windows-latest', python-version: '3.8', rpy2: 'true'}
- {os: 'macOS-latest', python-version: '3.8', rpy2: 'true'}
- {os: 'ubuntu-latest', python-version: '3.9', rpy2: 'true'}
- {os: 'ubuntu-latest', python-version: '3.10', rpy2: 'true'}
# - {os: 'ubuntu-latest', python-version: '3.11', rpy2: 'true'}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.config.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config.python-version }}
- name: Install vineknockoffs and dependencies
run: |
pip install --editable .
pip install pytest
- name: Install rpy2
if: matrix.config.rpy2 == 'true'
run: |
pip install rpy2
- name: Set up R
if: matrix.config.rpy2 == 'true'
uses: r-lib/actions/setup-r@v2
- name: Install R packages
if: matrix.config.rpy2 == 'true'
run: |
install.packages(c('glmnet', 'kde1d', 'TSP', 'VineCopula'))
shell: Rscript {0}
- name: Test with pytest
if: |
matrix.config.os != 'ubuntu-latest' ||
matrix.config.python-version != '3.8' ||
matrix.config.rpy2 == 'false'
run: |
pytest
- name: Test with pytest and coverage
if: |
matrix.config.os == 'ubuntu-latest' &&
matrix.config.python-version == '3.8' &&
matrix.config.rpy2 == 'true'
run: |
pip install pytest-cov
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
if: |
matrix.config.os == 'ubuntu-latest' &&
matrix.config.python-version == '3.8'
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests