Skip to content

Commit 1f2dbda

Browse files
committed
Add workflow to check if lib builds correct and can be used
1 parent ba2b709 commit 1f2dbda

File tree

3 files changed

+43
-24
lines changed

3 files changed

+43
-24
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build and Test Library
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: 3.9
21+
22+
- name: Install build tools and test dependencies
23+
run: |
24+
pip install build pytest
25+
26+
- name: Build the library
27+
run: |
28+
python -m build
29+
id: build
30+
31+
- name: Install built library
32+
run: |
33+
pip install dist/*.whl
34+
35+
- name: Verify library usage - Part I
36+
run: |
37+
echo "import flask_inputfilter" > test_script.py
38+
python test_script.py
39+
40+
- name: Verify library usage - Part II
41+
run: |
42+
PYTHONPATH="" pytest test/

.github/workflows/test.yaml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,6 @@ jobs:
3333
--cache-to=type=local,dest=/tmp/.buildx-cache,mode=max \
3434
-t flask-inputfilter . --load
3535
36-
# - name: Save flask-inputfilter image
37-
# run: docker save -o flask-inputfilter.tar flask-inputfilter
38-
#
39-
# - name: Upload flask-inputfilter artifact
40-
# uses: actions/upload-artifact@v4
41-
# with:
42-
# name: flask-inputfilter-image
43-
# path: flask-inputfilter.tar
44-
#
45-
# test:
46-
# runs-on: ubuntu-latest
47-
#
48-
# steps:
49-
# - name: Checkout code
50-
# uses: actions/checkout@v4
51-
#
52-
# - name: Download flask-inputfilter artifact
53-
# uses: actions/download-artifact@v4
54-
# with:
55-
# name: flask-inputfilter-image
56-
#
57-
# - name: Load flask-inputfilter image
58-
# run: docker load -i flask-inputfilter.tar
59-
6036
- name: Run tests in Docker and upload coverage to Coveralls
6137
env:
6238
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"Flask>=2.1",
1818
"pillow>=8.0.0",
1919
"requests>=2.22.0",
20+
"typing_extensions>=3.6.2",
2021
],
2122
classifiers=[
2223
"License :: OSI Approved :: MIT License",

0 commit comments

Comments
 (0)