microsoft/typespec
Publicmirrored from https://github.com/microsoft/typespecAvailable
.github/workflows/ci.yml
63lines · modecode
| 1 | name: CI |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - main |
| 7 | pull_request: |
| 8 | branches: |
| 9 | - main |
| 10 | - release/* |
| 11 | merge_group: |
| 12 | |
| 13 | permissions: |
| 14 | contents: read |
| 15 | |
| 16 | concurrency: |
| 17 | group: ${{ github.workflow }}-${{ github.ref }} |
| 18 | cancel-in-progress: true |
| 19 | |
| 20 | jobs: |
| 21 | changes: |
| 22 | name: Detect Changes |
| 23 | runs-on: ubuntu-slim |
| 24 | outputs: |
| 25 | core: ${{ steps.filter.outputs.core }} |
| 26 | steps: |
| 27 | - uses: actions/checkout@v6 |
| 28 | # cspell:ignore dorny |
| 29 | - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4 |
| 30 | id: filter |
| 31 | with: |
| 32 | predicate-quantifier: "every" |
| 33 | filters: | |
| 34 | core: |
| 35 | - '**' |
| 36 | - '!.prettierignore' |
| 37 | - '!.prettierrc.json' |
| 38 | - '!cspell.yaml' |
| 39 | - '!eslint.config.json' |
| 40 | - '!.chronus/**' |
| 41 | - '!eng/emitters/**' |
| 42 | - '!packages/http-client-csharp/**' |
| 43 | - '!packages/http-client-java/**' |
| 44 | - '!packages/http-client-python/**' |
| 45 | |
| 46 | core: |
| 47 | needs: changes |
| 48 | if: needs.changes.outputs.core == 'true' |
| 49 | uses: ./.github/workflows/core-ci.yml |
| 50 | |
| 51 | ci-gate: |
| 52 | name: CI Gate |
| 53 | runs-on: ubuntu-slim |
| 54 | if: "!cancelled() || needs.core.result == 'cancelled'" |
| 55 | needs: [core] |
| 56 | steps: |
| 57 | - name: Validate CI results |
| 58 | run: | |
| 59 | if [[ "${{ needs.core.result }}" == "failure" || "${{ needs.core.result }}" == "cancelled" ]]; then |
| 60 | echo "Core CI failed or was cancelled" |
| 61 | exit 1 |
| 62 | fi |
| 63 | echo "All CI checks passed or were appropriately skipped" |
| 64 | |