Lint Content-Hub #183
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: Lint 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: | |
| response_integrations_google: ${{ steps.filter.outputs.response_integrations_google }} | |
| response_integrations_third_party: ${{ steps.filter.outputs.response_integrations_third_party }} | |
| mp: ${{ steps.filter.outputs.mp }} | |
| package_envcommon: ${{ steps.filter.outputs.package_envcommon }} | |
| package_tipcommon: ${{ steps.filter.outputs.package_tipcommon }} | |
| package_integration_testing: ${{ steps.filter.outputs.package_integration_testing }} | |
| 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: | | |
| response_integrations_google: | |
| - 'content/response_integrations/google/**' | |
| response_integrations_third_party: | |
| - 'content/response_integrations/third_party/**' | |
| - 'content/response_integrations/power_up/**' | |
| mp: | |
| - 'packages/mp/**' | |
| package_envcommon: | |
| - 'packages/envcommon/**' | |
| package_tipcommon: | |
| - 'packages/tipcommon/**' | |
| package_integration_testing: | |
| - 'packages/integration_testing/**' | |
| lint_google: | |
| name: Lint Google Integrations | |
| needs: changes | |
| if: ${{ needs.changes.outputs.response_integrations_google == '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 Check | |
| shell: bash | |
| run: | | |
| mp config --root-path . --processes 10 --display-config | |
| cd content/response_integrations/google | |
| mp check --changed-files --raise-error-on-violations --output-format grouped | |
| lint_third_party: | |
| name: Lint Third-Party Integrations | |
| needs: changes | |
| if: ${{ needs.changes.outputs.response_integrations_third_party == '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 Check | |
| shell: bash | |
| run: | | |
| mp config --root-path . --processes 10 --display-config | |
| cd content/response_integrations/third_party | |
| mp check --changed-files --raise-error-on-violations --output-format grouped | |
| mp_package_linter: | |
| name: mp Package Linter | |
| needs: changes | |
| if: ${{ needs.changes.outputs.mp == '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 uv | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install uv | |
| - name: Run Ruff | |
| working-directory: packages/mp | |
| run: | | |
| uv sync --dev | |
| source .venv/bin/activate | |
| ruff check --output-format grouped | |
| - name: Run Ty | |
| working-directory: packages/mp | |
| run: | | |
| uv sync --dev | |
| source .venv/bin/activate | |
| ty check --output-format concise | |
| envcommon_linter: | |
| name: EnvironmentCommon Package Linter | |
| needs: changes | |
| if: ${{ needs.changes.outputs.package_envcommon == '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 uv | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install uv | |
| - name: Run Ruff | |
| working-directory: packages/envcommon/EnvironmentCommon | |
| run: | | |
| uv sync --dev | |
| source .venv/bin/activate | |
| ruff check --output-format grouped | |
| tipcommon_linter: | |
| name: TIPCommon Package Linter | |
| needs: changes | |
| if: ${{ needs.changes.outputs.package_tipcommon == '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 uv | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install uv | |
| - name: Run Ruff | |
| working-directory: packages/tipcommon/TIPCommon | |
| run: | | |
| uv sync --dev | |
| source .venv/bin/activate | |
| ruff check --output-format grouped | |
| integration_testing_linter: | |
| name: Integration Testing Package Linter | |
| needs: changes | |
| if: ${{ needs.changes.outputs.package_integration_testing == '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 uv | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install uv | |
| - name: Run Ruff | |
| working-directory: packages/integration_testing | |
| run: | | |
| uv sync --dev | |
| source .venv/bin/activate | |
| ruff check --output-format grouped |