Skip to content

Commit 4710f85

Browse files
committed
test
1 parent 7f28fcf commit 4710f85

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

.github/workflows/auto-testing.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010

1111
jobs:
1212
build:
13-
1413
runs-on: ubuntu-latest
1514
strategy:
1615
matrix:
@@ -48,4 +47,28 @@ jobs:
4847
run: |
4948
pip install readme-renderer
5049
python -m readme_renderer README.rst >/dev/null
51-
50+
51+
check-import:
52+
runs-on: ubuntu-latest
53+
strategy:
54+
matrix:
55+
python-version:
56+
- '3.8'
57+
- '3.9'
58+
- '3.10'
59+
- '3.11'
60+
- '3.12'
61+
steps:
62+
- uses: actions/checkout@v4
63+
with:
64+
submodules: true
65+
- name: Set up Python ${{ matrix.python-version }}
66+
uses: actions/setup-python@v5
67+
with:
68+
python-version: ${{ matrix.python-version }}
69+
- name: Install dependencies & lib
70+
run: |
71+
python -m pip install --upgrade pip
72+
pip install -e .
73+
- name: Run import check
74+
run: python import_check.py

import_check.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import pkgutil
2+
import importlib
3+
import linebot
4+
5+
def import_all_modules(package):
6+
for importer, modname, ispkg in pkgutil.walk_packages(package.__path__, package.__name__ + '.'):
7+
try:
8+
importlib.import_module(modname)
9+
print(f'Successfully imported {modname}')
10+
except ImportError as e:
11+
print(f'Failed to import {modname}: {e}')
12+
raise
13+
14+
import_all_modules(my_library_name)

0 commit comments

Comments
 (0)