Skip to content

Commit 57f184f

Browse files
authored
Merge pull request #61 from shankar524/add-test-ci-test-pipeline
Add CI pipeline for testing
2 parents 4a113b5 + 12355cd commit 57f184f

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
test:
11+
name: Test on ${{ matrix.python-version }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: ["3.11", "3.10"]
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Cache pip
28+
uses: actions/cache@v4
29+
with:
30+
path: ~/.cache/pip
31+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
32+
restore-keys: |
33+
${{ runner.os }}-pip-
34+
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
39+
# install this package so tests can import the package modules
40+
pip install -e .
41+
42+
- name: Run tests
43+
run: |
44+
pytest -q
45+
env:
46+
# reduce noisy deprecation warnings in CI logs
47+
PYTHONWARNINGS: ignore::DeprecationWarning

0 commit comments

Comments
 (0)