-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (171 loc) · 7.63 KB
/
Copy pathkas-build-ci.yml
File metadata and controls
200 lines (171 loc) · 7.63 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: KAS Build CI
on:
push:
branches: [ main, develop ]
paths:
- 'kas/**'
- 'meta-dynamicdevices-bsp/**'
- 'meta-dynamicdevices-distro/**'
- 'recipes-**'
- 'classes/**'
- 'conf/**'
- '.github/workflows/kas-build-ci.yml'
- 'scripts/kas-*.sh'
- 'scripts/validation/**'
- 'bbappends/**'
- 'custom-boot-files/**'
pull_request:
branches: [ main, develop ]
paths:
- 'kas/**'
- 'meta-dynamicdevices-bsp/**'
- 'meta-dynamicdevices-distro/**'
- 'recipes-**'
- 'classes/**'
- 'conf/**'
- '.github/workflows/kas-build-ci.yml'
- 'scripts/kas-*.sh'
- 'scripts/validation/**'
- 'bbappends/**'
- 'custom-boot-files/**'
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
env:
DEBIAN_FRONTEND: noninteractive
jobs:
# Validation job - validates Yocto layer compatibility
validate:
name: Validate Yocto Layers
runs-on: self-hosted
container:
image: dynamicdevices/yocto-ci-build:latest
options: --privileged --platform linux/amd64
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache KAS layers
uses: actions/cache@v4
with:
path: |
build/layers
build/cache
key: kas-layers-${{ hashFiles('kas/lmp-dynamicdevices-base.yml') }}-${{ github.sha }}
restore-keys: |
kas-layers-${{ hashFiles('kas/lmp-dynamicdevices-base.yml') }}-
kas-layers-
- name: Cache Yocto downloads
uses: actions/cache@v4
with:
path: ~/yocto/downloads
key: yocto-downloads-${{ runner.os }}-${{ hashFiles('kas/lmp-dynamicdevices-base.yml') }}
restore-keys: |
yocto-downloads-${{ runner.os }}-
- name: Validate Yocto Layers
timeout-minutes: 15
run: |
echo "🏅 Meta-DynamicDevices Layer Validation (CI)"
echo "============================================="
echo "📋 Using official yocto-check-layer for Yocto Project compliance"
echo ""
# Install KAS if not available
if ! command -v kas >/dev/null 2>&1; then
echo "📦 Installing KAS..."
pip3 install kas
fi
# Create validation workspace
VALIDATION_DIR="ci-layer-validation"
rm -rf "$VALIDATION_DIR"
mkdir -p "$VALIDATION_DIR"
cd "$VALIDATION_DIR"
echo "🔧 Setting up KAS environment for layer validation..."
# Copy KAS configuration for validation
cp ../kas/layer-validation.yml .
# Initialize KAS environment
echo "📋 Initializing KAS build environment..."
kas shell layer-validation.yml -c "echo 'KAS environment initialized'"
echo "✅ KAS environment ready"
echo ""
echo "🔍 Starting comprehensive layer validation..."
echo ""
# Run yocto-check-layer validation
echo "1️⃣ Validating all meta-dynamicdevices layers together..."
if kas shell layer-validation.yml -c "
# Use the yocto-check-layer script from openembedded-core
YOCTO_CHECK_LAYER='./layers/openembedded-core/scripts/yocto-check-layer'
if [ ! -f \"\$YOCTO_CHECK_LAYER\" ]; then
echo '❌ yocto-check-layer script not found at expected location'
exit 1
fi
echo '✅ Found yocto-check-layer: '\$YOCTO_CHECK_LAYER
# Clean up all potential conflicts from BitBake test data
rm -rf layers/bitbake/lib/layerindexlib/tests/testdata/ 2>/dev/null || true
find ../.. -name 'bitbake' -type d -exec rm -rf {}/lib/layerindexlib/tests/testdata/ 2>/dev/null \\; || true
# Clean up any other build directories that might cause collection conflicts
find ../.. -maxdepth 2 -name 'build*' -type d ! -path '*/ci-layer-validation/build' -exec echo '🧹 Temporarily moving {}' \\; -exec mv {} {}.bak 2>/dev/null \\; || true
# Run validation on all meta-dynamicdevices layers together to handle dependencies
echo '🔍 Running yocto-check-layer validation...'
python3 \"\$YOCTO_CHECK_LAYER\" \"$PWD/../meta-dynamicdevices-bsp\" \"$PWD/../meta-dynamicdevices-distro\" \"$PWD/..\"
# Restore moved directories
find ../.. -maxdepth 2 -name 'build*.bak' -type d -exec sh -c 'mv \"\$1\" \"\${1%.bak}\"' _ {} \\; 2>/dev/null || true
"; then
echo ""
echo "✅ meta-dynamicdevices layers validation PASSED"
echo ""
echo "============================================="
echo "✅ All layer validations PASSED"
echo "✅ All meta-dynamicdevices layers pass comprehensive yocto-check-layer validation!"
echo "✅ Layers are ready for Yocto Project compatibility."
echo ""
else
echo ""
echo "❌ meta-dynamicdevices layers validation FAILED"
echo ""
echo "============================================="
echo "❌ Layer validation FAILED"
echo ""
echo "ℹ️ Please fix the yocto-check-layer issues above before proceeding."
echo "ℹ️ Run './scripts/validate-layers-local.sh' locally to debug issues."
echo ""
exit 1
fi
# Cleanup validation workspace
cd ..
rm -rf "$VALIDATION_DIR"
# Summary job
summary:
name: Validation Summary
runs-on: self-hosted
needs: [validate]
if: always()
steps:
- name: Generate validation summary
run: |
echo "# KAS Layer Validation Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Workflow:** ${{ github.workflow }}" >> $GITHUB_STEP_SUMMARY
echo "**Trigger:** ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY
echo "**Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
echo "**Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# Determine overall status
if [ "${{ needs.validate.result }}" = "success" ]; then
echo "## ✅ Validation Status: SUCCESS" >> $GITHUB_STEP_SUMMARY
echo "All meta-dynamicdevices layers pass comprehensive yocto-check-layer validation!" >> $GITHUB_STEP_SUMMARY
echo "Layers are ready for Yocto Project compatibility." >> $GITHUB_STEP_SUMMARY
else
echo "## ❌ Validation Status: FAILED" >> $GITHUB_STEP_SUMMARY
echo "- Layer validation: ${{ needs.validate.result }}" >> $GITHUB_STEP_SUMMARY
echo "Please fix validation issues before proceeding." >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Validation Coverage" >> $GITHUB_STEP_SUMMARY
echo "- **Tool:** Official yocto-check-layer" >> $GITHUB_STEP_SUMMARY
echo "- **Layers:** meta-dynamicdevices, meta-dynamicdevices-bsp, meta-dynamicdevices-distro" >> $GITHUB_STEP_SUMMARY
echo "- **Compliance:** Full Yocto Project compatibility validation" >> $GITHUB_STEP_SUMMARY