Fix package author email #185
This file contains hidden or 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@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.9" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.7" | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync --no-dev --group test | |
| - name: Test CLI Commands | |
| run: | | |
| app_name="${{ matrix.app_type }}App" | |
| case "${{ matrix.app_type }}" in | |
| "Blank") | |
| uv run pynest generate application -n "$app_name" | |
| ;; | |
| "SyncORM") | |
| uv run pynest generate application -n "$app_name" -db sqlite | |
| ;; | |
| "AsyncORM") | |
| uv run pynest generate application -n "$app_name" -db sqlite --is-async | |
| ;; | |
| "MongoDB") | |
| uv run pynest generate application -n "$app_name" -db mongodb | |
| ;; | |
| "PostgresSync") | |
| uv run pynest generate application -n "$app_name" -db postgresql | |
| ;; | |
| "PostgresAsync") | |
| uv run pynest generate application -n "$app_name" -db postgresql --is-async | |
| ;; | |
| "MySQLSync") | |
| uv run pynest generate application -n "$app_name" -db mysql | |
| ;; | |
| "MySQLAsync") | |
| uv run pynest generate application -n "$app_name" -db mysql --is-async | |
| ;; | |
| esac | |
| cd "$app_name" | |
| uv run pynest generate resource -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 | |
| 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") | |
| 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 | |
| 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 | |
| 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." |