-
Notifications
You must be signed in to change notification settings - Fork 387
82 lines (75 loc) · 2.25 KB
/
Copy pathci.yml
File metadata and controls
82 lines (75 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
- release/*
merge_group:
permissions:
contents: read
pull-requests: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Detect Changes
runs-on: ubuntu-slim
outputs:
core: ${{ steps.core-filter.outputs.core }}
python: ${{ steps.python-filter.outputs.python }}
steps:
- uses: actions/checkout@v7
# cspell:ignore dorny
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4
id: core-filter
with:
predicate-quantifier: "every"
filters: |
core:
- '**'
- '!.prettierignore'
- '!.prettierrc.json'
- '!cspell.yaml'
- '!eslint.config.json'
- '!.chronus/**'
- '!eng/emitters/**'
- '!packages/http-client-csharp/**'
- '!packages/http-client-java/**'
- '!packages/http-client-python/**'
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4
id: python-filter
with:
filters: |
python:
- 'packages/http-client-python/**'
- '.github/workflows/ci.yml'
- '.github/workflows/ci-python.yml'
core:
needs: changes
if: needs.changes.outputs.core == 'true'
uses: ./.github/workflows/core-ci.yml
python:
needs: changes
if: needs.changes.outputs.python == 'true'
uses: ./.github/workflows/ci-python.yml
ci-gate:
name: CI Gate
runs-on: ubuntu-slim
if: "!cancelled() || contains(needs.*.result, 'cancelled')"
needs: [core, python]
steps:
- name: Validate CI results
run: |
if [[ "${{ needs.core.result }}" == "failure" || "${{ needs.core.result }}" == "cancelled" ]]; then
echo "Core CI failed or was cancelled"
exit 1
fi
if [[ "${{ needs.python.result }}" == "failure" || "${{ needs.python.result }}" == "cancelled" ]]; then
echo "Python CI failed or was cancelled"
exit 1
fi
echo "All CI checks passed or were appropriately skipped"