Skip to content

Commit 3de2b98

Browse files
chore: Use paths to filter triggers for test jobs in templates (#2627)
1 parent 27f2aad commit 3de2b98

File tree

3 files changed

+78
-6
lines changed
  • cookiecutter
    • mapper-template/{{cookiecutter.mapper_id}}/.github/workflows
    • tap-template/{{cookiecutter.tap_id}}/.github/workflows
    • target-template/{{cookiecutter.target_id}}/.github/workflows

3 files changed

+78
-6
lines changed

cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/test.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,26 @@
33

44
name: Test {{cookiecutter.mapper_id}}
55

6-
on: [push]
6+
on:
7+
push:
8+
branches: [main]
9+
paths:
10+
- .github/workflows/test.yml
11+
- {{ cookiecutter.library_name }}/**
12+
- tests/**
13+
- poetry.lock
14+
- pyproject.toml
15+
- tox.ini
16+
pull_request:
17+
branches: [main]
18+
paths:
19+
- .github/workflows/test.yml
20+
- {{ cookiecutter.library_name }}/**
21+
- tests/**
22+
- poetry.lock
23+
- pyproject.toml
24+
- tox.ini
25+
workflow_dispatch:
726

827
jobs:
928
pytest:
@@ -13,7 +32,12 @@ jobs:
1332
strategy:
1433
fail-fast: false
1534
matrix:
16-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
35+
python-version:
36+
- "3.8"
37+
- "3.9"
38+
- "3.10"
39+
- "3.11"
40+
- "3.12"
1741
steps:
1842
- uses: actions/checkout@v4
1943
- name: Set up Python {{ '${{ matrix.python-version }}' }}

cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/test.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,26 @@
33

44
name: Test {{cookiecutter.tap_id}}
55

6-
on: [push]
6+
on:
7+
push:
8+
branches: [main]
9+
paths:
10+
- .github/workflows/test.yml
11+
- {{ cookiecutter.library_name }}/**
12+
- tests/**
13+
- poetry.lock
14+
- pyproject.toml
15+
- tox.ini
16+
pull_request:
17+
branches: [main]
18+
paths:
19+
- .github/workflows/test.yml
20+
- {{ cookiecutter.library_name }}/**
21+
- tests/**
22+
- poetry.lock
23+
- pyproject.toml
24+
- tox.ini
25+
workflow_dispatch:
726

827
jobs:
928
pytest:
@@ -13,7 +32,12 @@ jobs:
1332
strategy:
1433
fail-fast: false
1534
matrix:
16-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
35+
python-version:
36+
- "3.8"
37+
- "3.9"
38+
- "3.10"
39+
- "3.11"
40+
- "3.12"
1741
steps:
1842
- uses: actions/checkout@v4
1943
- name: Set up Python {{ '${{ matrix.python-version }}' }}

cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/test.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,26 @@
33

44
name: Test {{cookiecutter.target_id}}
55

6-
on: [push]
6+
on:
7+
push:
8+
branches: [main]
9+
paths:
10+
- .github/workflows/test.yml
11+
- {{ cookiecutter.library_name }}/**
12+
- tests/**
13+
- poetry.lock
14+
- pyproject.toml
15+
- tox.ini
16+
pull_request:
17+
branches: [main]
18+
paths:
19+
- .github/workflows/test.yml
20+
- {{ cookiecutter.library_name }}/**
21+
- tests/**
22+
- poetry.lock
23+
- pyproject.toml
24+
- tox.ini
25+
workflow_dispatch:
726

827
jobs:
928
pytest:
@@ -13,7 +32,12 @@ jobs:
1332
strategy:
1433
fail-fast: false
1534
matrix:
16-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
35+
python-version:
36+
- "3.8"
37+
- "3.9"
38+
- "3.10"
39+
- "3.11"
40+
- "3.12"
1741
steps:
1842
- uses: actions/checkout@v4
1943
- name: Set up Python {{ '${{ matrix.python-version }}' }}

0 commit comments

Comments
 (0)