Test librarian with new wrkflw #34
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: CI Unit | |
| on: [pull_request] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| # ========================================================= | |
| # 1. DISCOVERY (Outputs up to 256 packages globally) | |
| # ========================================================= | |
| discover: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| packages: ${{ steps.changes.outputs.all_changed_files }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: changes | |
| uses: tj-actions/changed-files@v44 | |
| with: | |
| files: packages/** | |
| dir_names: true | |
| dir_names_max_depth: 2 | |
| matrix: true | |
| # ========================================================= | |
| # 2. EXECUTION (1 Job = 1 Package) | |
| # ========================================================= | |
| unit: | |
| needs: discover | |
| if: ${{ needs.discover.outputs.packages != '[]' && needs.discover.outputs.packages != '' }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 40 # Org limit protection | |
| matrix: | |
| package: ${{ fromJSON(needs.discover.outputs.packages) }} | |
| name: Unit (${{ matrix.package }}) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Run Python Versions Sequentially | |
| run: | | |
| cd ${{ matrix.package }} | |
| export NOX_DEFAULT_VENV_BACKEND=uv | |
| export UV_PRERELEASE=allow | |
| uvx --with 'nox[uv]' nox -s "unit-3.9" "unit-3.10" "unit-3.11" "unit-3.12" "unit-3.14" | |
| # ========================================================= | |
| # 3. AGGREGATOR (Branch Protection Target) | |
| # ========================================================= | |
| ci-unit-success: | |
| name: Unit Tests Success | |
| needs: [unit] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Verify matrix passed | |
| run: | | |
| if [ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" = "true" ]; then | |
| echo "::error::One or more unit tests failed." | |
| exit 1 | |
| fi | |
| echo "All unit tests passed!" |