Validate Content-Hub #159
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: Validate Content-Hub | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| paths: | |
| - 'content/**' | |
| - 'packages/**' | |
| - '.github/workflows/**' | |
| pull_request: | |
| branches: | |
| - '**' | |
| paths: | |
| - 'content/**' | |
| - 'packages/**' | |
| - '.github/workflows/**' | |
| permissions: | |
| contents: read | |
| jobs: | |
| changes: | |
| name: Detect Changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| mp: ${{ steps.filter.outputs.mp }} | |
| response_integrations_google: ${{ steps.filter.outputs.response_integrations_google }} | |
| response_integrations_third_party: ${{ steps.filter.outputs.response_integrations_third_party }} | |
| playbooks: ${{ steps.filter.outputs.playbooks }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for changes | |
| uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| base: ${{ github.event.pull_request.base.sha || github.event.before }} | |
| filters: | | |
| mp: | |
| - 'packages/mp/**' | |
| - '.github/workflows/**' | |
| response_integrations_google: | |
| - 'content/response_integrations/google/**' | |
| response_integrations_third_party: | |
| - 'content/response_integrations/third_party/**' | |
| - 'content/response_integrations/power_up/**' | |
| playbooks: | |
| - 'content/playbooks/**' | |
| # 1) mp Packages OR (Google + Third Party + Playbooks) | |
| validate_all: | |
| name: Validate All Content | |
| needs: changes | |
| if: ${{ needs.changes.outputs.mp == 'true' || (needs.changes.outputs.response_integrations_google == 'true' && needs.changes.outputs.response_integrations_third_party == 'true' && needs.changes.outputs.playbooks == 'true') }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install mp package | |
| run: | | |
| python -m pip install uv | |
| uv pip install --system -e ./packages/mp | |
| - name: Run Validation | |
| env: | |
| GITHUB_PR_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| run: | | |
| mp config --root-path . --processes 10 --display-config | |
| mp validate repository all_content --only-pre-build | |
| - name: Upload Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: validation-report | |
| path: artifacts/validation_report.md | |
| retention-days: 2 | |
| # 2) Google + Third Party | |
| validate_google_third_party: | |
| name: Validate Google & Third Party | |
| needs: changes | |
| if: ${{ needs.changes.outputs.mp != 'true' && needs.changes.outputs.response_integrations_google == 'true' && needs.changes.outputs.response_integrations_third_party == 'true' && needs.changes.outputs.playbooks != 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install mp package | |
| run: | | |
| python -m pip install uv | |
| uv pip install --system -e ./packages/mp | |
| - name: Run Validation | |
| env: | |
| GITHUB_PR_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| run: | | |
| mp config --root-path . --processes 10 --display-config | |
| mp validate repository google third_party --only-pre-build | |
| - name: Upload Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: validation-report | |
| path: artifacts/validation_report.md | |
| retention-days: 2 | |
| # 3) Google + Playbooks | |
| validate_google_playbooks: | |
| name: Validate Google & Playbooks | |
| needs: changes | |
| if: ${{ needs.changes.outputs.mp != 'true' && needs.changes.outputs.response_integrations_google == 'true' && needs.changes.outputs.response_integrations_third_party != 'true' && needs.changes.outputs.playbooks == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install mp package | |
| run: | | |
| python -m pip install uv | |
| uv pip install --system -e ./packages/mp | |
| - name: Run Validation | |
| env: | |
| GITHUB_PR_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| run: | | |
| mp config --root-path . --processes 10 --display-config | |
| mp validate repository google playbooks --only-pre-build | |
| - name: Upload Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: validation-report | |
| path: artifacts/validation_report.md | |
| retention-days: 2 | |
| # 4) Third Party + Playbooks | |
| validate_third_party_playbooks: | |
| name: Validate Third Party & Playbooks | |
| needs: changes | |
| if: ${{ needs.changes.outputs.mp != 'true' && needs.changes.outputs.response_integrations_google != 'true' && needs.changes.outputs.response_integrations_third_party == 'true' && needs.changes.outputs.playbooks == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install mp package | |
| run: | | |
| python -m pip install uv | |
| uv pip install --system -e ./packages/mp | |
| - name: Run Validation | |
| env: | |
| GITHUB_PR_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| run: | | |
| mp config --root-path . --processes 10 --display-config | |
| mp validate repository third_party playbooks --only-pre-build | |
| - name: Upload Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: validation-report | |
| path: artifacts/validation_report.md | |
| retention-days: 2 | |
| # 5) Only Google | |
| validate_google: | |
| name: Validate Google Integrations | |
| needs: changes | |
| if: ${{ needs.changes.outputs.mp != 'true' && needs.changes.outputs.response_integrations_google == 'true' && needs.changes.outputs.response_integrations_third_party != 'true' && needs.changes.outputs.playbooks != 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install mp package | |
| run: | | |
| python -m pip install uv | |
| uv pip install --system -e ./packages/mp | |
| - name: Run Validation | |
| env: | |
| GITHUB_PR_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| run: | | |
| mp config --root-path . --processes 10 --display-config | |
| mp validate repository google --only-pre-build | |
| - name: Upload Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: validation-report | |
| path: artifacts/validation_report.md | |
| retention-days: 2 | |
| # 6) Only Third Party | |
| validate_third_party: | |
| name: Validate Third-Party Integrations | |
| needs: changes | |
| if: ${{ needs.changes.outputs.mp != 'true' && needs.changes.outputs.response_integrations_google != 'true' && needs.changes.outputs.response_integrations_third_party == 'true' && needs.changes.outputs.playbooks != 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install mp package | |
| run: | | |
| python -m pip install uv | |
| uv pip install --system -e ./packages/mp | |
| - name: Run Validation | |
| env: | |
| GITHUB_PR_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| run: | | |
| mp config --root-path . --processes 10 --display-config | |
| mp validate repository third_party --only-pre-build | |
| - name: Upload Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: validation-report | |
| path: artifacts/validation_report.md | |
| retention-days: 2 | |
| # 7) Only Playbooks | |
| validate_playbooks: | |
| name: Validate Playbooks | |
| needs: changes | |
| if: ${{ needs.changes.outputs.mp != 'true' && needs.changes.outputs.response_integrations_google != 'true' && needs.changes.outputs.response_integrations_third_party != 'true' && needs.changes.outputs.playbooks == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install mp package | |
| run: | | |
| python -m pip install uv | |
| uv pip install --system -e ./packages/mp | |
| - name: Run Validation | |
| env: | |
| GITHUB_PR_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| run: | | |
| mp config --root-path . --processes 10 --display-config | |
| mp validate repository playbooks --only-pre-build | |
| - name: Upload Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: validation-report | |
| path: artifacts/validation_report.md | |
| retention-days: 2 |