Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions .github/workflows/auto-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -47,4 +46,34 @@ jobs:
run: |
pip install readme-renderer
python -m readme_renderer README.rst >/dev/null


check-import:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Update version in linebot/__about__.py
run: |
VERSION="12.3.0"
VERSION=${VERSION#v}
sed -i "s/__version__ = '__LINE_BOT_SDK_PYTHON_VERSION__'/__version__ = '$VERSION'/g" linebot/__about__.py
cat linebot/__about__.py

- name: Install dependencies & lib
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Run import check
run: python import_check.py
14 changes: 14 additions & 0 deletions import_check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import pkgutil
import importlib
import linebot

def import_all_modules(package):
for importer, modname, ispkg in pkgutil.walk_packages(package.__path__, package.__name__ + '.'):
try:
importlib.import_module(modname)
print(f'Successfully imported {modname}')
except Exception as e:
print(f'Failed to import {modname}: {e}')
raise

import_all_modules(linebot)
Loading