Skip to content

Commit 1739a17

Browse files
committed
added github actions
1 parent 6a690e5 commit 1739a17

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/pytests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Run TestCases
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
branches:
9+
- "main"
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, 3.10]
18+
19+
steps:
20+
# Checkout the latest code from the repo
21+
- name: Checkout repo
22+
uses: actions/checkout@v2
23+
# Setup which version of Python to use
24+
- name: Set Up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
# Display the Python version being used
29+
- name: Display Python version
30+
run: python -c "import sys; print(sys.version)"
31+
# Install the package using the setup.py
32+
- name: Install package
33+
run: python setup.py install
34+
# Install pytest (you can use some other testing utility)
35+
- name: Install coverage
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install coverage
39+
# Run the tests. I'm using pytest and the file is in the tests directory.
40+
- name: Run tests
41+
run: coverage run -m unittest thepeer/tests/thepeer_test.py

0 commit comments

Comments
 (0)