Skip to content

Commit 750ffe0

Browse files
authored
Merge pull request #28 from avinassh/tests-workflow
Run tests on pull request
2 parents 3e38cea + 77f4412 commit 750ffe0

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/pr-tests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: pytest
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
name: Run pytest
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: '>=3.10'
21+
22+
- name: Set up cargo cache
23+
uses: actions/cache@v3
24+
continue-on-error: false
25+
with:
26+
path: |
27+
~/.cargo/bin/
28+
~/.cargo/registry/index/
29+
~/.cargo/registry/cache/
30+
~/.cargo/git/db/
31+
target/
32+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
33+
restore-keys: ${{ runner.os }}-cargo-
34+
35+
- name: Buidl and run tests
36+
run: |
37+
python3 -m venv .env # maturin requires a virtualenv
38+
source .env/bin/activate
39+
pip3 install maturin pytest
40+
maturin develop
41+
pytest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
target
33
*.db
44
client_wal_index
5+
tests/__pycache__

0 commit comments

Comments
 (0)