Skip to content

Commit

Permalink
Updated pr-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-EJ committed May 16, 2024
1 parent 57c333c commit fb04c2d
Showing 1 changed file with 38 additions and 9 deletions.
47 changes: 38 additions & 9 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ on:
- 'main'

jobs:
run-pr-checks:
run-lint:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v3
with:
Expand All @@ -26,12 +25,42 @@ jobs:

- name: Run lint check
run: python -m flake8 --append-config air-quality-backend/.flake8 air-quality-backend

run-pr-checks:
runs-on: ubuntu-latest
outputs:

- name: Run unit tests
run: python -m pytest --cov=src --cov=scripts --cov-report=xml:air-quality-backend/tests/coverage/test_report.xml air-quality-backend/tests

- name: Code Coverage Report
uses: orgoro/[email protected]
defaults:
run:
shell: bash -el {0}
steps:
- name: Paths Changes Filter
uses: dorny/[email protected]
id: filter
with:
coverageFile: air-quality-backend/tests/coverage/test_report.xml
token: ${{ secrets.GITHUB_TOKEN }}
filters: |
etl:
- 'src/etl/**'
- name: backend tests
if: steps.filter.outputs.etl == 'true'
run:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge
environment-file: air-quality-backend/conda/etl_environment.yml
auto-activate-base: false
activate-environment: etl-dev

- name: Run etl unit tests
run: python -m pytest --cov=src --cov=scripts --cov-report=xml:air-quality-backend/tests/coverage/etl_test_report.xml air-quality-backend/tests/etl_tests

- name: Code Coverage Report
uses: orgoro/[email protected]
with:
coverageFile: air-quality-backend/tests/coverage/etl_test_report.xml
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit fb04c2d

Please sign in to comment.