Skip to content

[CI/CD;DevEx]: Scope sample and source-change workflows to skip unnecessary jobs #43

[CI/CD;DevEx]: Scope sample and source-change workflows to skip unnecessary jobs

[CI/CD;DevEx]: Scope sample and source-change workflows to skip unnecessary jobs #43

name: Samples Postman
on:
pull_request:
# Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below.
paths:
- samples/schema/postman-collection/python/**
- samples/schema/postman-collection/postman.json
- .github/workflows/samples-postman.yaml
jobs:
setup:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.filter.outputs.matrix }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- id: filter
uses: ./.github/actions/compute-matrix
with:
# List of sample directories to consider building (one per line).
# Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script.
# To add a new sample: add it here AND add a matching entry to the paths: trigger above.
all_samples: |
samples/schema/postman-collection
"3.12"
build:
name: Test Python client
needs: setup
if: ${{ needs.setup.outputs.matrix != '[]' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install
working-directory: ${{ matrix.sample }}
run: |
pip install -r python/requirements.txt
pip install -r python/test-requirements.txt
- name: Test
working-directory: ${{ matrix.sample }}
run: python -m pytest