feat(install): auto-discover target disk and run CopyFiles before GRUB #319
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will build a Java project with Ant | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-ant | |
| name: Java CI | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| workflow_dispatch: | |
| # Cancel in-progress runs of the same ref when a new commit lands. | |
| concurrency: | |
| group: ant-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 8 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '8' | |
| distribution: 'zulu' | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y nasm yasm | |
| - name: Build ISO and compile tests | |
| run: | | |
| ./build.sh clean -Dbuild.properties.file=../.github/qemu/jnode.properties cd-x86-combined-lite regression-tests | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jnode-build | |
| path: | | |
| */build/** | |
| all/lib/classlib.jar | |
| retention-days: 1 | |
| if-no-files-found: error | |
| test: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 8 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '8' | |
| distribution: 'zulu' | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: jnode-build | |
| - name: Run regression tests | |
| run: ./test.sh all | |
| - name: Publish Test Summary | |
| uses: test-summary/action@v2 | |
| with: | |
| paths: '**/build/reports/junit/*.xml' | |
| show: 'all' | |
| if: always() | |
| - name: Upload Test Results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jnode_test_results.zip | |
| path: | | |
| **/build/reports/junit/ | |
| if: always() | |
| boot32: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y qemu-system-x86 xorriso | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: jnode-build | |
| - name: Build CI ISO (32-bit tests) | |
| run: | | |
| SRC=./all/build/cdroms/jnode-x86-combined-lite.iso | |
| EXTRACT=/tmp/jnode-iso-extract | |
| rm -rf $EXTRACT | |
| xorriso -osirrox on -indev "$SRC" -extract / "$EXTRACT" 2>&1 | tail -3 | |
| chmod -R u+w "$EXTRACT" | |
| cp .github/qemu/menu-ci-32.lst "$EXTRACT/boot/grub/menu.lst" | |
| xorriso -as mkisofs -o /tmp/jnode-ci-32.iso \ | |
| -b boot/grub/eltorito.s2 -no-emul-boot -boot-load-size 4 -boot-info-table \ | |
| "$EXTRACT" 2>&1 | tail -1 | |
| - name: Run QEMU Boot Test (32-bit) | |
| run: | | |
| echo "Starting JNode 32-bit in QEMU" | |
| rm -f /tmp/com1.txt | |
| touch /tmp/com1.txt | |
| qemu-system-x86_64 -cdrom /tmp/jnode-ci-32.iso -m 1024 -M pc -cpu pentium -boot once=d,menu=off -net none -serial file:/tmp/com1.txt -display none & | |
| qemu_pid=$! | |
| sleep 1 | |
| tail -f /tmp/com1.txt & | |
| tail_pid=$! | |
| timeout 120s bash -c 'until grep -q -i "System has finished" /tmp/com1.txt; do sleep 1; done' || { | |
| echo "32-bit boot failed or timed out!" | |
| cat /tmp/com1.txt | |
| kill $qemu_pid $tail_pid || true | |
| exit 1 | |
| } | |
| echo "Successfully booted JNode 32-bit!" | |
| kill $qemu_pid $tail_pid || true | |
| - name: Upload Boot Log | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jnode_boot_log_32bit | |
| path: /tmp/com1.txt | |
| if: always() | |
| boot64: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y qemu-system-x86 xorriso | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: jnode-build | |
| - name: Build CI ISO (64-bit shell) | |
| run: | | |
| SRC=./all/build/cdroms/jnode-x86-combined-lite.iso | |
| EXTRACT=/tmp/jnode-iso-extract | |
| rm -rf $EXTRACT | |
| xorriso -osirrox on -indev "$SRC" -extract / "$EXTRACT" 2>&1 | tail -3 | |
| chmod -R u+w "$EXTRACT" | |
| cp .github/qemu/menu-ci-64.lst "$EXTRACT/boot/grub/menu.lst" | |
| xorriso -as mkisofs -o /tmp/jnode-ci-64.iso \ | |
| -b boot/grub/eltorito.s2 -no-emul-boot -boot-load-size 4 -boot-info-table \ | |
| "$EXTRACT" 2>&1 | tail -1 | |
| - name: Run QEMU Boot Test (64-bit) | |
| run: | | |
| echo "Starting JNode 64-bit in QEMU" | |
| rm -f /tmp/com1_64.txt | |
| touch /tmp/com1_64.txt | |
| qemu-system-x86_64 -cdrom /tmp/jnode-ci-64.iso -m 1024 -M pc -cpu qemu64 -boot once=d,menu=off -net none -serial file:/tmp/com1_64.txt -display none & | |
| qemu_pid=$! | |
| sleep 1 | |
| tail -f /tmp/com1_64.txt & | |
| tail_pid=$! | |
| timeout 120s bash -c 'until grep -q -i "System has finished" /tmp/com1_64.txt; do sleep 1; done' || { | |
| echo "64-bit boot failed or timed out!" | |
| cat /tmp/com1_64.txt | |
| kill $qemu_pid $tail_pid || true | |
| exit 1 | |
| } | |
| echo "Successfully booted JNode 64-bit!" | |
| kill $qemu_pid $tail_pid || true | |
| - name: Upload Boot Log | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jnode_boot_log_64bit | |
| path: /tmp/com1_64.txt | |
| if: always() |