Skip to content

Commit 24582ac

Browse files
committed
add tests
1 parent ace6d88 commit 24582ac

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

.github/workflows/format.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: Run Python linter and formatter
22

33
on:
44
push:
5-
branches: [ 'main', 'improved-api']
5+
branches: [ 'main' ]
66
paths:
77
- '**.py'
88

99
pull_request:
10-
branches: [ 'main', 'improved-api' ]
10+
branches: [ 'main' ]
1111
paths:
1212
- '**.py'
1313

.github/workflows/tests.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Run Python tests
2+
3+
on:
4+
push:
5+
branches: [ 'main' ]
6+
paths:
7+
- '**.py'
8+
9+
pull_request:
10+
branches: [ 'main' ]
11+
paths:
12+
- '**.py'
13+
14+
jobs:
15+
test_package:
16+
17+
name: Test ${{ matrix.os }} Python ${{ matrix.python_version }}
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: ["ubuntu-20.04"]
23+
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
24+
steps:
25+
- uses: actions/checkout@v3
26+
- name: Setup python
27+
uses: actions/setup-python@v2
28+
with:
29+
30+
python-version: ${{ matrix.python_version }}
31+
architecture: x64
32+
- name: Install dependencies
33+
run: |
34+
python3 -m pip install --upgrade pip
35+
python3 -m pip install -r requirements-dev.txt
36+
python3 -m pip install -e src
37+
- name: Run the migrations
38+
run: |
39+
python3 -m flask --app src.flaskapp db upgrade --directory src/flaskapp/migrations
40+
env:
41+
DATABASE_FILENAME: testdb.db
42+
- name: Run tests
43+
run: python3 -m pytest
44+
env:
45+
DATABASE_FILENAME: testdb.db

0 commit comments

Comments
 (0)