|
| 1 | +name: 🧪 Verify Package Dependencies |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ['*'] |
| 6 | + |
| 7 | +env: |
| 8 | + DEBIAN_FRONTEND: noninteractive |
| 9 | + |
| 10 | +jobs: |
| 11 | + verify-dependencies: |
| 12 | + name: 🛠️ ${{ matrix.os }}-${{ matrix.arch }} |
| 13 | + runs-on: ${{ matrix.runs_on }} |
| 14 | + timeout-minutes: 30 |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + include: |
| 19 | + - os: ubuntu-22.04 |
| 20 | + arch: x86_64 |
| 21 | + runs_on: ubuntu-22.04 |
| 22 | + codename: jammy |
| 23 | + - os: ubuntu-22.04 |
| 24 | + arch: aarch64 |
| 25 | + runs_on: ubuntu-22.04 |
| 26 | + codename: jammy |
| 27 | + - os: ubuntu-24.04 |
| 28 | + arch: x86_64 |
| 29 | + runs_on: ubuntu-24.04 |
| 30 | + codename: noble |
| 31 | + - os: ubuntu-24.04 |
| 32 | + arch: aarch64 |
| 33 | + runs_on: ubuntu-24.04 |
| 34 | + codename: noble |
| 35 | + |
| 36 | + steps: |
| 37 | + - name: Checkout repository |
| 38 | + uses: actions/checkout@v4 |
| 39 | + with: |
| 40 | + fetch-depth: 1 |
| 41 | + |
| 42 | + - name: Set up environment |
| 43 | + run: | |
| 44 | + echo "CONTROL_FILE=packages/Debian/${{ matrix.arch }}/DEBIAN/control" >> $GITHUB_ENV |
| 45 | + echo "REPORT=dep_report_${{ matrix.os }}_${{ matrix.arch }}.md" >> $GITHUB_ENV |
| 46 | +
|
| 47 | + - name: Validate control file exists |
| 48 | + run: | |
| 49 | + if [ ! -f "$CONTROL_FILE" ]; then |
| 50 | + echo "❌ Control file missing: $CONTROL_FILE" |
| 51 | + echo "Available files in packages/Debian/:" |
| 52 | + find packages/Debian/ -name "control" 2>/dev/null || echo "No control files found" |
| 53 | + exit 1 |
| 54 | + fi |
| 55 | + echo "✅ Control file found: $CONTROL_FILE" |
| 56 | +
|
| 57 | + - name: Verify dependencies & generate report |
| 58 | + env: |
| 59 | + TARGET_OS: ${{ matrix.os }} |
| 60 | + TARGET_ARCH: ${{ matrix.arch }} |
| 61 | + TARGET_CODENAME: ${{ matrix.codename }} |
| 62 | + run: | |
| 63 | + # Run the dedicated dependency verification script with proper error handling |
| 64 | + set -e # Exit on any error |
| 65 | + echo "🚀 Starting dependency verification..." |
| 66 | +
|
| 67 | + if ! ./scripts/verify-dependencies.sh \ |
| 68 | + "$CONTROL_FILE" \ |
| 69 | + "$REPORT" \ |
| 70 | + "$TARGET_OS" \ |
| 71 | + "$TARGET_ARCH" \ |
| 72 | + "$TARGET_CODENAME"; then |
| 73 | + echo "❌ Dependency verification script failed with exit code $?" |
| 74 | + echo "::error::Dependency verification failed for $TARGET_ARCH on $TARGET_OS ($TARGET_CODENAME)" |
| 75 | + exit 1 |
| 76 | + fi |
| 77 | +
|
| 78 | + echo "✅ Dependency verification completed successfully" |
| 79 | +
|
| 80 | + - name: Validate report was generated |
| 81 | + run: | |
| 82 | + if [ ! -f "$REPORT" ] || [ ! -s "$REPORT" ]; then |
| 83 | + echo "❌ Report file is missing or empty" |
| 84 | + exit 1 |
| 85 | + fi |
| 86 | + echo "✅ Report generated successfully ($(wc -l < "$REPORT") lines)" |
| 87 | +
|
| 88 | + - name: Add summary to job |
| 89 | + if: always() |
| 90 | + run: | |
| 91 | + echo "# 📦 Summary" >> $GITHUB_STEP_SUMMARY |
| 92 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 93 | + if [ -f "$REPORT" ]; then |
| 94 | + cat "$REPORT" >> $GITHUB_STEP_SUMMARY |
| 95 | + else |
| 96 | + echo "❌ Report generation failed" >> $GITHUB_STEP_SUMMARY |
| 97 | + fi |
| 98 | +
|
| 99 | + - name: Check for failures |
| 100 | + if: failure() |
| 101 | + run: | |
| 102 | + echo "❌ Dependency verification failed for ${{ matrix.os }} (${{ matrix.arch }})" |
| 103 | + echo "This indicates build or runtime dependencies are missing." |
| 104 | + echo "Please review the generated report and update the control file or repository configuration." |
| 105 | + exit 1 |
0 commit comments