|
17 | 17 | OUTPUT_DIR: /workdir/out |
18 | 18 |
|
19 | 19 | jobs: |
20 | | - validate: |
21 | | - runs-on: ubuntu-latest |
22 | | - steps: |
23 | | - - name: Checkout Repository |
24 | | - uses: actions/checkout@v4 |
25 | | - |
26 | | - - name: Validate package list |
27 | | - run: | |
28 | | - # Check if package list exists |
29 | | - if [ ! -f packages.x86_64 ]; then |
30 | | - echo "::error::packages.x86_64 file not found" |
31 | | - exit 1 |
32 | | - fi |
33 | | -
|
34 | | - # Check for duplicate packages |
35 | | - sort packages.x86_64 | uniq -d > duplicates.txt |
36 | | - if [ -s duplicates.txt ]; then |
37 | | - echo "::error::Duplicate packages found:" |
38 | | - cat duplicates.txt |
39 | | - exit 1 |
40 | | - fi |
41 | | - |
42 | | - # Validate package names exist in Arch repos |
43 | | - docker run --rm -v "${{ github.workspace }}/packages.x86_64:/packages.x86_64:ro" archlinux:latest bash -c " |
44 | | - set -euo pipefail |
45 | | - pacman -Syu --noconfirm |
46 | | - while read -r pkg; do |
47 | | - [[ \$pkg =~ ^# ]] && continue |
48 | | - [[ -z \$pkg ]] && continue |
49 | | - if ! pacman -Si \$pkg >/dev/null 2>&1; then |
50 | | - echo \"::error::Package not found: \$pkg\" |
51 | | - exit 1 |
52 | | - fi |
53 | | - done < /packages.x86_64 |
54 | | - " |
55 | | -
|
56 | | - security-scan: |
57 | | - runs-on: ubuntu-latest |
58 | | - steps: |
59 | | - - name: Checkout Repository |
60 | | - uses: actions/checkout@v4 |
61 | | - |
62 | | - - name: Run Security Scan |
63 | | - uses: aquasecurity/trivy-action@master |
64 | | - with: |
65 | | - scan-type: 'fs' |
66 | | - ignore-unfixed: true |
67 | | - format: 'sarif' |
68 | | - output: 'trivy-results.sarif' |
69 | | - severity: 'CRITICAL,HIGH' |
70 | | - |
71 | | - - name: Upload Scan Results |
72 | | - uses: github/codeql-action/upload-sarif@v3 |
73 | | - if: always() |
74 | | - with: |
75 | | - sarif_file: 'trivy-results.sarif' |
76 | | - |
77 | 20 | test-build: |
78 | | - needs: [validate, security-scan] |
79 | 21 | runs-on: ubuntu-latest |
80 | 22 | timeout-minutes: 120 |
81 | 23 |
|
|
104 | 46 | docker exec arch-container bash -c " |
105 | 47 | set -euo pipefail |
106 | 48 | pacman -Syu --noconfirm |
107 | | - pacman -S --noconfirm --needed git archiso grub |
| 49 | + pacman -S --noconfirm --needed git archiso grub qemu |
108 | 50 | " |
109 | 51 |
|
110 | 52 | - name: Test Build |
@@ -149,6 +91,16 @@ jobs: |
149 | 91 | echo '::error::ISO checksum verification failed' |
150 | 92 | exit 1 |
151 | 93 | } |
| 94 | +
|
| 95 | + # Verify ISO bootability |
| 96 | + qemu-system-x86_64 -cdrom \"\$iso_file\" -boot d -m 512 -nographic -net none -no-reboot -serial mon:stdio -display none -kernel /boot/vmlinuz-linux -initrd /boot/initramfs-linux.img -append \"console=ttyS0\" || { |
| 97 | + echo '::error::ISO bootability test failed' |
| 98 | + exit 1 |
| 99 | + } |
| 100 | +
|
| 101 | + # Generate additional checksums |
| 102 | + md5sum \"\$iso_file\" > checksum.md5 |
| 103 | + sha1sum \"\$iso_file\" > checksum.sha1 |
152 | 104 | " |
153 | 105 |
|
154 | 106 | - name: Clean Up |
|
0 commit comments