[EPAC-2153]: add MP lobbying exposure endpoint #21
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Backend Python tests | |
| on: | |
| pull_request: | |
| paths: | |
| - 'backend/cabinet/**' | |
| - 'backend/corrections-statistics/**' | |
| - 'backend/cpi-statistics/**' | |
| - 'backend/cpp-oas-statistics/**' | |
| - 'backend/ei-statistics/**' | |
| - 'backend/fiscal-monitor/**' | |
| - 'backend/lobbying/**' | |
| - 'backend/pbo/**' | |
| - 'backend/student-finance-statistics/**' | |
| - 'backend/transport-safety-statistics/**' | |
| - 'backend/vac-statistics/**' | |
| - 'backend/statistics_artifacts.py' | |
| - 'backend/statistics-requirements.txt' | |
| jobs: | |
| changes: | |
| name: Detect changed pipelines | |
| runs-on: ubuntu-latest | |
| outputs: | |
| pipelines: ${{ steps.detect.outputs.pipelines }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Detect which pipelines changed | |
| id: detect | |
| run: | | |
| CHANGED=$(git diff --name-only "origin/$GITHUB_BASE_REF"...HEAD) | |
| PIPELINES=() | |
| if echo "$CHANGED" | grep -Eq '^backend/(statistics_artifacts.py|statistics-requirements.txt)$'; then | |
| PIPELINES=(corrections-statistics cpi-statistics cpp-oas-statistics ei-statistics fiscal-monitor student-finance-statistics transport-safety-statistics vac-statistics) | |
| else | |
| for pipeline in cabinet corrections-statistics cpi-statistics cpp-oas-statistics ei-statistics fiscal-monitor lobbying pbo student-finance-statistics transport-safety-statistics vac-statistics; do | |
| if echo "$CHANGED" | grep -q "^backend/$pipeline/"; then | |
| PIPELINES+=("$pipeline") | |
| fi | |
| done | |
| fi | |
| if [ ${#PIPELINES[@]} -eq 0 ]; then | |
| echo 'pipelines=[]' >> "$GITHUB_OUTPUT" | |
| else | |
| PIPELINES_JSON=$(printf '%s\n' "${PIPELINES[@]}" | jq -R . | jq -c -s .) | |
| echo "pipelines=$PIPELINES_JSON" >> "$GITHUB_OUTPUT" | |
| fi | |
| python-tests: | |
| name: python-tests / ${{ matrix.pipeline }} | |
| needs: changes | |
| if: needs.changes.outputs.pipelines != '[]' && needs.changes.outputs.pipelines != '' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| pipeline: ${{ fromJSON(needs.changes.outputs.pipelines) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Run unittest suite | |
| working-directory: backend/${{ matrix.pipeline }} | |
| run: python3 -m unittest |