Skip to content

Commit d3b25e3

Browse files
committed
added test workflow
1 parent 7dc88d8 commit d3b25e3

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/test.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
7+
branches:
8+
- "*"
9+
schedule:
10+
- cron: "0 13 * * 1"
11+
12+
jobs:
13+
build:
14+
name: Build (${{ matrix.python-version }} | ${{ matrix.os }})
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
20+
python-version: ["3.8", "3.9", "3.10"]
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Cache conda
24+
uses: actions/cache@v3
25+
env:
26+
# Increase this value to reset cache if ci/environment.yml has not changed
27+
CACHE_NUMBER: 0
28+
with:
29+
path: ~/conda_pkgs_dir
30+
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-py${{ matrix.python-version }}.yml') }}
31+
- uses: conda-incubator/setup-miniconda@v2
32+
with:
33+
mamba-version: "*" # activate this to build with mamba.
34+
channels: conda-forge, defaults # These need to be specified to use mamba
35+
# channel-priority: true
36+
environment-file: ci/environment-py${{ matrix.python-version }}.yml
37+
38+
activate-environment: test_env_cf-pandas
39+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
40+
- name: Set up conda environment
41+
shell: bash -l {0}
42+
run: |
43+
python -m pip install -e . --no-deps --force-reinstall
44+
- name: Run Tests
45+
shell: bash -l {0}
46+
run: |
47+
pytest --cov=./ --cov-report=xml
48+
- name: Upload code coverage to Codecov
49+
uses: codecov/codecov-action@v3
50+
with:
51+
file: ./coverage.xml
52+
flags: unittests
53+
env_vars: OS,PYTHON
54+
name: codecov-umbrella
55+
fail_ci_if_error: false

0 commit comments

Comments
 (0)