diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 00000000..abef8c7a --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,62 @@ +name: Unit Tests + +on: + push: + branches: [main] + paths-ignore: + - '*.md' + - 'docs/**' + - 'scripts/**' + - '.github/**' + - '.vscode/**' + - '.cursor/**' + - '.claude/**' + - 'Makefile' + - '.env.example' + - '.gitattributes' + - 'example_prompts/**' + - 'example_project/**' + - 'example_workspace/**' + - 'staging/**' + - '*.log' + - 'LICENSE' + pull_request: + branches: [main] + +jobs: + unit-tests: + if: github.event.pull_request.draft != true + name: Run Unit Tests + runs-on: ubuntu-latest + timeout-minutes: 30 + + env: + PDD_PATH: ${{ github.workspace }}/pdd + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + + - name: Install dependencies + run: pip install -e ".[dev]" pytest-timeout + + - name: Run unit tests + run: > + pytest tests/ + -m "not integration and not e2e and not real" + -v --tb=short --timeout=60 -n auto + --ignore=tests/commands/test_connect.py + --ignore=tests/test_bug_to_unit_test.py + --ignore=tests/test_context_generator.py + --ignore=tests/test_crash_main.py + --ignore=tests/test_generate_test.py + --ignore=tests/test_fix_error_loop.py + --ignore=tests/test_llm_invoke.py + --deselect=tests/test_setup_tool.py::test_create_api_env_script_with_special_characters_zsh + --deselect=tests/test_setup_tool.py::test_create_api_env_script_with_common_problematic_characters