mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
test creating disk and files
This commit is contained in:
parent
97b27601f6
commit
8f5f120cbf
1 changed files with 76 additions and 1 deletions
77
.github/workflows/build-and-test.yml
vendored
77
.github/workflows/build-and-test.yml
vendored
|
|
@ -17,8 +17,30 @@ env:
|
|||
VARIANT: 'Server'
|
||||
|
||||
jobs:
|
||||
check-changes:
|
||||
name: Check Changes
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
container: ${{ steps.changes.outputs.container }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: changes
|
||||
with:
|
||||
filters: |
|
||||
container:
|
||||
- 'Containerfile'
|
||||
- '/lorax_templates/**'
|
||||
- '/xorriso/**'
|
||||
- '/Makefile'
|
||||
- '/entrypoint.sh'
|
||||
|
||||
build-container:
|
||||
runs-on: ubuntu-latest
|
||||
if: needs.check-changes.outputs.container == 'true'
|
||||
needs:
|
||||
- check-changes
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
|
@ -57,10 +79,13 @@ jobs:
|
|||
build-and-push-iso:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- check-changes
|
||||
- build-container
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
outputs:
|
||||
artifact_url: ${{ steps.upload.outputs.artifact-url }}
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
|
|
@ -79,7 +104,19 @@ jobs:
|
|||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
|
||||
- name: Build ISO
|
||||
- name: Build ISO with new container
|
||||
if: needs.check-changes.outputs.container == 'true'
|
||||
uses: ./
|
||||
with:
|
||||
arch: ${{ env.ARCH}}
|
||||
image_name: ${{ env.IMAGE_NAME}}
|
||||
image_repo: ${{ env.IMAGE_REPO}}
|
||||
version: ${{ env.VERSION }}
|
||||
variant: ${{ env.VARIANT }}
|
||||
action_version: ${{ steps.meta.outputs.tags }}
|
||||
|
||||
- name: Build ISO with latest container
|
||||
if: needs.check-changes.outputs.container == 'false'
|
||||
uses: ./
|
||||
with:
|
||||
arch: ${{ env.ARCH}}
|
||||
|
|
@ -94,6 +131,7 @@ jobs:
|
|||
mv build/deploy.iso build/${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso
|
||||
|
||||
- name: Upload ISO as artifact
|
||||
id: upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso
|
||||
|
|
@ -102,3 +140,40 @@ jobs:
|
|||
retention-days: 0
|
||||
compression-level: 0
|
||||
overwrite: true
|
||||
|
||||
test-qemu:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build-and-push-iso
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Ensure qemu is installed
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y qemu qemu-utils xorriso unzip
|
||||
|
||||
- name: Create disk
|
||||
run: |
|
||||
qemu-img create -f qcow2 disk.qcow2 50G
|
||||
|
||||
- name: Add anaconda.ks to ISO
|
||||
run: |
|
||||
wget ${{ needs.build-and-push-iso.outputs.artifact_url }}
|
||||
ls
|
||||
unzip *.zip
|
||||
cat << EOF > ks.cfg
|
||||
|
||||
EOF
|
||||
xorriso -dialog on << EOF
|
||||
-indev ${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso
|
||||
-outdev test.iso
|
||||
-map ks.cfg ks.cfg
|
||||
-chmod 0444 ks.cfg
|
||||
-end
|
||||
EOF
|
||||
|
||||
#- name: Start a VM
|
||||
# run: |
|
||||
# qemu-system-x86_64 --name "Anaconda" -m 4096 -cpu host -cdrom test.iso -drive file=disk.qcow2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue