Skip to content

Commit 7f4ae8b

Browse files
committed
Add CI/GHA recipe
1 parent e7a3e2c commit 7f4ae8b

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.github/workflows/tests.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
# Allow job to be triggered manually.
10+
workflow_dispatch:
11+
12+
# Cancel in-progress jobs when pushing to the same branch.
13+
concurrency:
14+
cancel-in-progress: true
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
17+
jobs:
18+
19+
tests:
20+
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
matrix:
24+
os: ["ubuntu-latest"]
25+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
26+
fail-fast: false
27+
28+
services:
29+
cratedb:
30+
image: crate/crate:nightly
31+
ports:
32+
- 5432:5432
33+
34+
env:
35+
OS: ${{ matrix.os }}
36+
PYTHON: ${{ matrix.python-version }}
37+
38+
name: Python ${{ matrix.python-version }} on OS ${{ matrix.os }}
39+
steps:
40+
41+
- name: Acquire sources
42+
uses: actions/checkout@v3
43+
44+
- name: Setup Python
45+
uses: actions/setup-python@v4
46+
with:
47+
python-version: ${{ matrix.python-version }}
48+
architecture: x64
49+
cache: 'pip'
50+
cache-dependency-path: 'pyproject.toml'
51+
52+
- name: Setup project
53+
run: |
54+
55+
# `setuptools 0.64.0` adds support for editable install hooks (PEP 660).
56+
# https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v6400
57+
pip install "setuptools>=64" --upgrade
58+
59+
# Install package in editable mode.
60+
pip install --editable=.[test,develop]
61+
62+
- name: Run linter and software tests
63+
run: poe check
64+
65+
- name: Upload coverage to Codecov
66+
uses: codecov/codecov-action@v3
67+
with:
68+
files: ./coverage.xml
69+
flags: unittests
70+
env_vars: OS,PYTHON
71+
name: codecov-umbrella
72+
fail_ci_if_error: false

0 commit comments

Comments
 (0)