mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-02-22 17:44:20 -08:00
Skip PR workflows if no changes to files
This commit is contained in:
parent
dd43b64579
commit
666eac2df4
2 changed files with 43 additions and 10 deletions
32
.github/workflows/pr_backend.yml
vendored
32
.github/workflows/pr_backend.yml
vendored
|
@ -1,17 +1,31 @@
|
||||||
name: Pull Request Backend
|
name: Pull Request Backend
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
|
||||||
- "data/**"
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
env:
|
|
||||||
CENSUS_API_KEY: ${{ secrets.CENSUS_API_KEY }}
|
|
||||||
J40_VERSION_LABEL_STRING: ${{ vars.SCORE_VERSION }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# JOB to run change detection
|
||||||
|
detect-be-changes:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# Required permissions
|
||||||
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
|
# Set job outputs to values from filter step
|
||||||
|
outputs:
|
||||||
|
backend: ${{ steps.filter.outputs.backend }}
|
||||||
|
steps:
|
||||||
|
# For pull requests it's not necessary to checkout the code
|
||||||
|
- uses: dorny/paths-filter@v3
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
backend:
|
||||||
|
- 'data/**'
|
||||||
code-quality-checks:
|
code-quality-checks:
|
||||||
|
needs: detect-be-changes
|
||||||
|
if: ${{ needs.detect-be-changes.outputs.backend == 'true' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
|
@ -48,7 +62,12 @@ jobs:
|
||||||
run: poetry run pylint data_pipeline/
|
run: poetry run pylint data_pipeline/
|
||||||
- name: Check library safety
|
- name: Check library safety
|
||||||
run: poetry run safety check --ignore 51457 --ignore 44715 --ignore 70612
|
run: poetry run safety check --ignore 51457 --ignore 44715 --ignore 70612
|
||||||
|
- name: Run unit tests
|
||||||
|
run: |
|
||||||
|
poetry run pytest data_pipeline/
|
||||||
generate-score-tiles:
|
generate-score-tiles:
|
||||||
|
needs: detect-be-changes
|
||||||
|
if: ${{ needs.detect-be-changes.outputs.backend == 'true' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
|
@ -84,9 +103,6 @@ jobs:
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get -y install gdal-bin
|
sudo apt-get -y install gdal-bin
|
||||||
ogrinfo --version
|
ogrinfo --version
|
||||||
- name: Run unit tests
|
|
||||||
run: |
|
|
||||||
poetry run pytest data_pipeline/
|
|
||||||
- name: Cleanup Data
|
- name: Cleanup Data
|
||||||
run: |
|
run: |
|
||||||
poetry run python3 -m data_pipeline.application data-cleanup
|
poetry run python3 -m data_pipeline.application data-cleanup
|
||||||
|
|
21
.github/workflows/pr_frontend.yml
vendored
21
.github/workflows/pr_frontend.yml
vendored
|
@ -1,13 +1,30 @@
|
||||||
name: Pull Request Frontend
|
name: Pull Request Frontend
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
|
||||||
- "client/**"
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
jobs:
|
jobs:
|
||||||
|
# JOB to run change detection
|
||||||
|
detect-fe-changes:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# Required permissions
|
||||||
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
|
# Set job outputs to values from filter step
|
||||||
|
outputs:
|
||||||
|
backend: ${{ steps.filter.outputs.frontend }}
|
||||||
|
steps:
|
||||||
|
# For pull requests it's not necessary to checkout the code
|
||||||
|
- uses: dorny/paths-filter@v3
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
frontend:
|
||||||
|
- 'client/**'
|
||||||
frontend-build:
|
frontend-build:
|
||||||
|
needs: detect-fe-changes
|
||||||
|
if: ${{ needs.detect-fe-changes.outputs.frontend == 'true' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: PR
|
environment: PR
|
||||||
defaults:
|
defaults:
|
||||||
|
|
Loading…
Add table
Reference in a new issue