Module decorator is not creating the EXPORT metadata correctly. I bel… #64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CLI Test | |
on: [ push, workflow_call, pull_request ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
app_type: [ "Blank", "SyncORM", "AsyncORM", "MongoDB", "PostgresSync", "PostgresAsync", "MySQLSync", "MySQLAsync" ] | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install . | |
- name: Test CLI Commands | |
run: | | |
app_name="${{ matrix.app_type }}App" | |
case "${{ matrix.app_type }}" in | |
"Blank") | |
pynest create-nest-app -n "$app_name" | |
;; | |
"SyncORM") | |
pynest create-nest-app -n "$app_name" -db sqlite | |
;; | |
"AsyncORM") | |
pynest create-nest-app -n "$app_name" -db sqlite --is-async | |
;; | |
"MongoDB") | |
pynest create-nest-app -n "$app_name" -db mongodb | |
;; | |
"PostgresSync") | |
pynest create-nest-app -n "$app_name" -db postgresql | |
;; | |
"PostgresAsync") | |
pynest create-nest-app -n "$app_name" -db postgresql --is-async | |
;; | |
"MySQLSync") | |
pynest create-nest-app -n "$app_name" -db mysql | |
;; | |
"MySQLAsync") | |
pynest create-nest-app -n "$app_name" -db mysql --is-async | |
;; | |
esac | |
cd "$app_name" | |
pynest g module -n user | |
- name: Verify Boilerplate | |
run: | | |
app_name="${{ matrix.app_type }}App" | |
if [ -d "$app_name" ]; then | |
echo "Directory $app_name exists." | |
else | |
echo "Directory $app_name does not exist." | |
exit 1 | |
fi | |
if [ -d "$app_name/src/user" ]; then | |
echo "Directory $app_name/src/user exists." | |
else | |
echo "Directory $app_name does not exist." | |
exit 1 | |
fi | |
# List of expected files | |
declare -a files=("main.py" "requirements.txt" "README.md") | |
declare -a src_level_files=("app_module.py" "app_service.py" "app_controller.py") | |
declare -a module_files=("user_controller.py" "user_service.py" "user_module.py" "user_model.py") | |
# Check each file in the list of files | |
for file in "${files[@]}"; do | |
if [ -f "$app_name/$file" ]; then | |
echo "$file exists in $app_name." | |
else | |
echo "$file does not exist in $app_name." | |
exit 1 | |
fi | |
done | |
# Check each file in the list of files | |
for file in "${src_level_files[@]}"; do | |
if [ -f "$app_name/src/$file" ]; then | |
echo "$file exists in $app_name." | |
else | |
echo "$file does not exist in $app_name." | |
exit 1 | |
fi | |
done | |
# Check each file in the list of module_files | |
for file in "${module_files[@]}"; do | |
if [ -f "$app_name/src/user/$file" ]; then | |
echo "$file exists in $app_name." | |
else | |
echo "$file does not exist in $app_name." | |
exit 1 | |
fi | |
done | |
echo "Boilerplate for ${{ matrix.app_type }} generated successfully." |