mirror of
https://github.com/pi-hole/pi-hole
synced 2025-07-09 16:48:06 +00:00
Only run the full test suite if required files are touched. This prevents the whole workflow from running for meta/readme changes
Same for CodeQL and python files Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
parent
8f7f92cd23
commit
0676f38978
21
.github/workflows/codeql-analysis.yml
vendored
21
.github/workflows/codeql-analysis.yml
vendored
@ -13,7 +13,28 @@ on:
|
||||
- cron: '32 11 * * 6'
|
||||
|
||||
jobs:
|
||||
# JOB to run change detection
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
# Set job outputs to values from filter step
|
||||
outputs:
|
||||
python: ${{ steps.filter.outputs.python }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout Repo
|
||||
uses: actions/checkout@v3.0.2
|
||||
-
|
||||
name: Check which files have been touched
|
||||
uses: dorny/paths-filter@v2.10.2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
python:
|
||||
- 'test/*.py'
|
||||
|
||||
analyze:
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.python == 'true' }}
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
15
.github/workflows/test.yml
vendored
15
.github/workflows/test.yml
vendored
@ -17,10 +17,10 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v3.0.2
|
||||
-
|
||||
name: Check which files have been touched
|
||||
uses: dorny/paths-filter@v2
|
||||
uses: dorny/paths-filter@v2.10.2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
@ -31,6 +31,7 @@ jobs:
|
||||
- 'test/**'
|
||||
- 'gravity.sh'
|
||||
- 'pihole'
|
||||
- '.github/workflows/test.yml'
|
||||
|
||||
smoke-tests:
|
||||
if: github.event.pull_request.draft == false
|
||||
@ -62,7 +63,7 @@ jobs:
|
||||
|
||||
distro-test:
|
||||
needs: [ smoke-tests, changes ]
|
||||
if: ${{ github.event.pull_request.draft == false && needs.changes.outputs.requires-distro-test == 'true' }}
|
||||
if: ${{ github.event.pull_request.draft == false }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@ -73,15 +74,23 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout repository
|
||||
if: ${{ needs.changes.outputs.requires-distro-test == 'true' }}
|
||||
uses: actions/checkout@v3.0.2
|
||||
-
|
||||
name: Set up Python 3.8
|
||||
if: ${{ needs.changes.outputs.requires-distro-test == 'true' }}
|
||||
uses: actions/setup-python@v4.1.0
|
||||
with:
|
||||
python-version: 3.8
|
||||
-
|
||||
name: Install dependencies
|
||||
if: ${{ needs.changes.outputs.requires-distro-test == 'true' }}
|
||||
run: pip install -r test/requirements.txt
|
||||
-
|
||||
name: Test with tox
|
||||
if: ${{ needs.changes.outputs.requires-distro-test == 'true' }}
|
||||
run: tox -c test/tox.${DISTRO}.ini
|
||||
-
|
||||
name: Passed with nothing to do
|
||||
if: ${{ needs.changes.outputs.requires-distro-test == 'false' }}
|
||||
run: echo "Nothing to test!"
|
||||
|
Loading…
Reference in New Issue
Block a user