Skip to content

Commit b634753

Browse files
authored
Merge pull request #6 from jluethi/testing
Add github workflows for testing
2 parents eca46bc + 14d2e5a commit b634753

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

.github/workflows/ci_pip.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI (pip)
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
10+
jobs:
11+
12+
tests:
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest]
16+
python-version: ["3.9", "3.10", "3.11"]
17+
name: "Core, Python ${{ matrix.python-version }}, ${{ matrix.os }}"
18+
runs-on: ${{ matrix.os }}
19+
timeout-minutes: 30
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 1
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
cache: "pip"
31+
32+
- name: Install package
33+
run: python -m pip install .[dev,test]
34+
35+
- name: Install some testing dependencies (hard-coded)
36+
run: python -m pip install pytest devtools jsonschema requests wget pooch
37+
38+
- name: Cache Pooch folder
39+
id: cache-pooch-folder
40+
uses: actions/cache@v3
41+
with:
42+
path: ~/.cache/pooch
43+
key: pooch-cache
44+
45+
- name: Test tasks with pytest
46+
run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing -s --log-cli-level debug
47+
48+
- name: Upload coverage reports to Codecov
49+
uses: codecov/[email protected]
50+
with:
51+
token: ${{ secrets.CODECOV_TOKEN }}
52+
slug: jluethi/fractal-helper-tasks

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dependencies = [
1919
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies)
2020
[project.optional-dependencies]
2121
dev = ["devtools", "pytest", "requests", "build", "jsonschema"]
22+
test = ["pytest", "pytest-cov"]
2223

2324
# Build options (see https://peps.python.org/pep-0517)
2425
[build-system]

0 commit comments

Comments
 (0)