mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-02-22 01:31:25 -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
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "data/**"
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
env:
|
||||
CENSUS_API_KEY: ${{ secrets.CENSUS_API_KEY }}
|
||||
J40_VERSION_LABEL_STRING: ${{ vars.SCORE_VERSION }}
|
||||
|
||||
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:
|
||||
needs: detect-be-changes
|
||||
if: ${{ needs.detect-be-changes.outputs.backend == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
|
@ -48,7 +62,12 @@ jobs:
|
|||
run: poetry run pylint data_pipeline/
|
||||
- name: Check library safety
|
||||
run: poetry run safety check --ignore 51457 --ignore 44715 --ignore 70612
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
poetry run pytest data_pipeline/
|
||||
generate-score-tiles:
|
||||
needs: detect-be-changes
|
||||
if: ${{ needs.detect-be-changes.outputs.backend == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
|
@ -84,9 +103,6 @@ jobs:
|
|||
sudo apt-get update
|
||||
sudo apt-get -y install gdal-bin
|
||||
ogrinfo --version
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
poetry run pytest data_pipeline/
|
||||
- name: Cleanup Data
|
||||
run: |
|
||||
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
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "client/**"
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
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:
|
||||
needs: detect-fe-changes
|
||||
if: ${{ needs.detect-fe-changes.outputs.frontend == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
environment: PR
|
||||
defaults:
|
||||
|
|
Loading…
Add table
Reference in a new issue