Skip to content

Commit c71a76d

Browse files
authored
Merge pull request #26 from IBM/jo5ta/dev
Add presentation slides and doc agent
2 parents 77894b5 + cffe2c7 commit c71a76d

File tree

6 files changed

+1907
-22
lines changed

6 files changed

+1907
-22
lines changed

.github/workflows/ci.yml

Lines changed: 95 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,91 @@ permissions:
1919
packages: write
2020

2121
jobs:
22+
# ============================================
23+
# Detect what changed (fast, no container)
24+
# ============================================
25+
changes:
26+
runs-on: ubuntu-latest
27+
outputs:
28+
code: ${{ steps.filter.outputs.code }}
29+
tests: ${{ steps.filter.outputs.tests }}
30+
docs: ${{ steps.filter.outputs.docs }}
31+
ci: ${{ steps.filter.outputs.ci }}
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
38+
- name: Detect changed paths
39+
id: filter
40+
run: |
41+
set -euo pipefail
42+
43+
if [ "${{ github.event_name }}" = "pull_request" ]; then
44+
BASE="${{ github.event.pull_request.base.sha }}"
45+
HEAD="${{ github.event.pull_request.head.sha }}"
46+
else
47+
# Push event: compare with parent commit
48+
BASE="${{ github.event.before }}"
49+
HEAD="${{ github.sha }}"
50+
51+
# Handle first push or force push (before is all zeros)
52+
if [ "$BASE" = "0000000000000000000000000000000000000000" ]; then
53+
# Compare against parent of HEAD
54+
BASE="${HEAD}^"
55+
fi
56+
fi
57+
58+
CHANGED=$(git diff --name-only "$BASE" "$HEAD" 2>/dev/null || echo "")
59+
60+
# Default all to false
61+
CODE=false
62+
TESTS=false
63+
DOCS=false
64+
CI_FILES=false
65+
66+
# Check each pattern (only if CHANGED is non-empty)
67+
if [ -n "$CHANGED" ]; then
68+
if echo "$CHANGED" | grep -qE '^(tracing_library/|decoder_tool/|command_line_tool/|snapshot_library/|kernel_tracing_library/|cmake/|CMakeLists\.txt|CMakePresets\.json)'; then
69+
CODE=true
70+
fi
71+
72+
if echo "$CHANGED" | grep -qE '^(tests/|examples/)'; then
73+
TESTS=true
74+
fi
75+
76+
if echo "$CHANGED" | grep -qE '^docs/|\.md$'; then
77+
DOCS=true
78+
fi
79+
80+
if echo "$CHANGED" | grep -qE '^(\.github/|scripts/)'; then
81+
CI_FILES=true
82+
fi
83+
fi
84+
85+
echo "code=$CODE" >> $GITHUB_OUTPUT
86+
echo "tests=$TESTS" >> $GITHUB_OUTPUT
87+
echo "docs=$DOCS" >> $GITHUB_OUTPUT
88+
echo "ci=$CI_FILES" >> $GITHUB_OUTPUT
89+
90+
echo "Changed files:"
91+
echo "$CHANGED"
92+
echo ""
93+
echo "Detected: code=$CODE tests=$TESTS docs=$DOCS ci=$CI_FILES"
94+
2295
# ============================================
2396
# Quick checks (format, version) - fail fast
97+
# Skip only for docs-only changes
2498
# ============================================
2599
checks:
26100
runs-on: ubuntu-latest
101+
needs: changes
102+
if: |
103+
github.event_name == 'push' ||
104+
needs.changes.outputs.code == 'true' ||
105+
needs.changes.outputs.tests == 'true' ||
106+
needs.changes.outputs.ci == 'true'
27107
steps:
28108
- name: Checkout code
29109
uses: actions/checkout@v4
@@ -46,10 +126,17 @@ jobs:
46126

47127
# ============================================
48128
# Build and Test
129+
# Skip only for docs-only changes
49130
# ============================================
50131
build-and-test:
51132
runs-on: ubuntu-latest
52-
needs: checks
133+
needs: [changes, checks]
134+
if: |
135+
!failure() && !cancelled() &&
136+
(github.event_name == 'push' ||
137+
needs.changes.outputs.code == 'true' ||
138+
needs.changes.outputs.tests == 'true' ||
139+
needs.changes.outputs.ci == 'true')
53140
steps:
54141
- name: Checkout code
55142
uses: actions/checkout@v4
@@ -84,11 +171,16 @@ jobs:
84171
run: ./scripts/container.sh ./scripts/ci-cd/step_memcheck.sh
85172

86173
# ============================================
87-
# Packaging
174+
# Packaging (only for code/ci changes, or push to main)
88175
# ============================================
89176
package:
90177
runs-on: ubuntu-latest
91-
needs: build-and-test
178+
needs: [changes, build-and-test]
179+
if: |
180+
!failure() && !cancelled() &&
181+
(github.event_name == 'push' ||
182+
needs.changes.outputs.code == 'true' ||
183+
needs.changes.outputs.ci == 'true')
92184
steps:
93185
- name: Checkout code
94186
uses: actions/checkout@v4

0 commit comments

Comments
 (0)