-
Notifications
You must be signed in to change notification settings - Fork 4
79 lines (67 loc) · 2.35 KB
/
testing.yml
File metadata and controls
79 lines (67 loc) · 2.35 KB
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
name: Tests and Examples
permissions:
contents: read
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *' # Every day at 00:00 UTC
jobs:
test:
name: Run Tests and Examples
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.11, 3.12]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Conda with Mamba
uses: conda-incubator/setup-miniconda@v2
with:
use-mamba: true
auto-activate-base: false
miniforge-variant: Miniforge3
- name: Create environment
run: |
mamba env create -f .github/workflows/conda_envs/python${{ matrix.python-version }}.yml
mamba run -n plaid_python${{ matrix.python-version }} pip install -e .
- name: Run tests on Unix
if: runner.os != 'Windows'
run: |
mamba run -n plaid_python${{ matrix.python-version }} pytest tests --cov=src --cov-report=xml --cov-report=term
- name: Run tests on Windows
if: runner.os == 'Windows'
shell: powershell
run: |
mamba run -n plaid_python${{ matrix.python-version }} pytest tests
- name: Run examples on Unix
if: runner.os != 'Windows'
run: |
cd examples
mamba run -n plaid_python${{ matrix.python-version }} bash run_examples.sh
- name: Run examples on Windows
if: runner.os == 'Windows'
shell: powershell
run: |
cd examples
mamba run -n plaid_python${{ matrix.python-version }} run_examples.bat
- name: Upload coverage to Codecov (Linux only)
if: runner.os == 'Linux'
uses: codecov/codecov-action@v4
with:
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
name: python-${{ matrix.python-version }}
verbose: true
# - name: Set up Miniconda
# uses: conda-incubator/setup-miniconda@v2
# with:
# miniforge-variant: Miniforge3
# miniforge-version: latest
# use-mamba: true
# auto-activate-base: false
# auto-update-conda: true
# activate-environment: plaid_python${{ matrix.python-version }}
# environment-file: .github/workflows/conda_envs/python${{ matrix.python-version }}.yml