diff --git a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/test.yml b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/test.yml index 2bbeebf75..1399f9f8c 100644 --- a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/test.yml +++ b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/test.yml @@ -3,7 +3,26 @@ name: Test {{cookiecutter.mapper_id}} -on: [push] +on: + push: + branches: [main] + paths: + - .github/workflows/test.yml + - {{ cookiecutter.library_name }}/** + - tests/** + - poetry.lock + - pyproject.toml + - tox.ini + pull_request: + branches: [main] + paths: + - .github/workflows/test.yml + - {{ cookiecutter.library_name }}/** + - tests/** + - poetry.lock + - pyproject.toml + - tox.ini + workflow_dispatch: jobs: pytest: @@ -13,7 +32,12 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" steps: - uses: actions/checkout@v4 - name: Set up Python {{ '${{ matrix.python-version }}' }} diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/test.yml b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/test.yml index a6a631c2c..85aba9d26 100644 --- a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/test.yml +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/test.yml @@ -3,7 +3,26 @@ name: Test {{cookiecutter.tap_id}} -on: [push] +on: + push: + branches: [main] + paths: + - .github/workflows/test.yml + - {{ cookiecutter.library_name }}/** + - tests/** + - poetry.lock + - pyproject.toml + - tox.ini + pull_request: + branches: [main] + paths: + - .github/workflows/test.yml + - {{ cookiecutter.library_name }}/** + - tests/** + - poetry.lock + - pyproject.toml + - tox.ini + workflow_dispatch: jobs: pytest: @@ -13,7 +32,12 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" steps: - uses: actions/checkout@v4 - name: Set up Python {{ '${{ matrix.python-version }}' }} diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/test.yml b/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/test.yml index fda907e07..2ed7a8bc5 100644 --- a/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/test.yml +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/test.yml @@ -3,7 +3,26 @@ name: Test {{cookiecutter.target_id}} -on: [push] +on: + push: + branches: [main] + paths: + - .github/workflows/test.yml + - {{ cookiecutter.library_name }}/** + - tests/** + - poetry.lock + - pyproject.toml + - tox.ini + pull_request: + branches: [main] + paths: + - .github/workflows/test.yml + - {{ cookiecutter.library_name }}/** + - tests/** + - poetry.lock + - pyproject.toml + - tox.ini + workflow_dispatch: jobs: pytest: @@ -13,7 +32,12 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" steps: - uses: actions/checkout@v4 - name: Set up Python {{ '${{ matrix.python-version }}' }}