Skip to content

Commit 8d27797

Browse files
committed
test
1 parent cd97fa7 commit 8d27797

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