Skip to content

Update pr-build.yml #26

Update pr-build.yml

Update pr-build.yml #26

Workflow file for this run

name: pr-build

Check failure on line 1 in .github/workflows/pr-build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/pr-build.yml

Invalid workflow file

Invalid `steps` value - steps should be list of `uses` or `run` items
on:
pull_request:
types: ['opened', 'reopened', 'synchronize']
branches:
- 'main'
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
etl: ${{ steps.filter.outputs.etl }}
api: ${{ steps.filter.outputs.api }}
steps:
uses: dorny/[email protected]
id: filter
with:
filters: |
etl:
- 'air-quality-backend/src/etl/**'
api:
- 'air-quality-backend/src/api/**'
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:
channels: conda-forge
environment-file: air-quality-backend/conda/test_environment.yml
auto-activate-base: false
activate-environment: unit-test
- name: Run lint check
run: python -m flake8 --append-config air-quality-backend/.flake8 air-quality-backend
etl:
needs: changes
if: ${{ needs.changes.outputs.etl == 'true' }}
runs-on: ubuntu-latest
outputs:
defaults:
run:
shell: bash -el {0}
steps:
- 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 }}