Repository navigation
refactor(ci): isolate tooling and select component validation (#223) #18
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 | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| schedule: | |
| - cron: '17 6 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| changes: | |
| name: Select affected components | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| tooling: ${{ steps.select.outputs.tooling }} | |
| runtime: ${{ steps.select.outputs.runtime }} | |
| cli: ${{ steps.select.outputs.cli }} | |
| postgres: ${{ steps.select.outputs.postgres }} | |
| surrealdb: ${{ steps.select.outputs.surrealdb }} | |
| mssql: ${{ steps.select.outputs.mssql }} | |
| cel: ${{ steps.select.outputs.cel }} | |
| site: ${{ steps.select.outputs.site }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Select checks | |
| id: select | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| BASE_REVISION: ${{ github.event.pull_request.base.sha }} | |
| run: | | |
| args=(--head HEAD) | |
| if [[ "$EVENT_NAME" == pull_request ]]; then | |
| args+=(--base "$BASE_REVISION") | |
| else | |
| args+=(--full) | |
| fi | |
| python3 scripts/ci/select_checks.py "${args[@]}" | |
| validation: | |
| needs: changes | |
| uses: ./.github/workflows/full-validation.yml | |
| with: | |
| tooling: ${{ needs.changes.outputs.tooling == 'true' }} | |
| runtime: ${{ needs.changes.outputs.runtime == 'true' }} | |
| cli: ${{ needs.changes.outputs.cli == 'true' }} | |
| postgres: ${{ needs.changes.outputs.postgres == 'true' }} | |
| surrealdb: ${{ needs.changes.outputs.surrealdb == 'true' }} | |
| mssql: ${{ needs.changes.outputs.mssql == 'true' }} | |
| cel: ${{ needs.changes.outputs.cel == 'true' }} | |
| site: ${{ needs.changes.outputs.site == 'true' }} | |
| base: ${{ github.event.pull_request.base.sha || '' }} | |
| site-candidate-server: ${{ needs.changes.outputs.runtime == 'true' || needs.changes.outputs.cli == 'true' || needs.changes.outputs.surrealdb == 'true' || needs.changes.outputs.postgres == 'true' || needs.changes.outputs.mssql == 'true' }} | |
| required: | |
| name: Required CI | |
| needs: [changes, validation] | |
| if: always() | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Require selection and validation to succeed | |
| env: | |
| NEEDS_JSON: ${{ toJSON(needs) }} | |
| run: python3 scripts/ci/check_results.py required |