diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index cae216e..63e52a8 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -139,14 +139,13 @@ jobs: compression-level: 0 overwrite: true - test-qemu: + test-iso: name: Test ISO runs-on: ubuntu-latest needs: - build-and-push-iso permissions: contents: read - packages: write continue-on-error: false strategy: fail-fast: false @@ -167,10 +166,6 @@ jobs: sudo apt-get install -y make sudo make install-test-deps PACKAGE_MANAGER=apt-get - - name: Create disk - run: | - qemu-img create -f qcow2 disk.qcow2 50G - - name: Download generated ISO uses: actions/download-artifact@v4 with: @@ -197,6 +192,38 @@ jobs: SECURE_BOOT_KEY_URL=${{ env.SECURE_BOOT_KEY_URL }} \ ENROLLMENT_PASSWORD=${{ env.ENROLLMENT_PASSWORD }} + test-deployment: + name: Test deployment + runs-on: ubuntu-latest + needs: + - build-and-push-iso + permissions: + contents: read + continue-on-error: false + strategy: + fail-fast: false + matrix: + version: + - 38 + - 39 + - 40 + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install test tools + run: | + sudo apt-get update + sudo apt-get install -y make + sudo make install-test-deps PACKAGE_MANAGER=apt-get + + - name: Download generated ISO + uses: actions/download-artifact@v4 + with: + name: ${{ needs['build-and-push-iso']['outputs'][format('iso_name-{0}', matrix.version)] }} + - name: Add Kickstart and Grub options to ISO run: | set -e @@ -228,6 +255,10 @@ jobs: -end EOF + - name: Create VM disk + run: | + qemu-img create -f qcow2 disk.qcow2 50G + - name: Install the test VM run: | set -e diff --git a/.github/workflows/variables.yml b/.github/workflows/variables.yml new file mode 100644 index 0000000..6d92fb8 --- /dev/null +++ b/.github/workflows/variables.yml @@ -0,0 +1,24 @@ +name: Repo Tests + +on: + push: + branches: + - 'main' + tags: + - 'v*' + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + variables: + name: Check variables are listed + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Run test + run: | + /bin/bash bash tests/repo/vars.sh \ No newline at end of file diff --git a/Makefile b/Makefile index b3db5dc..1af1850 100644 --- a/Makefile +++ b/Makefile @@ -20,9 +20,12 @@ FLATPAK_REMOTE_REFS_DIR = # Secure boot ENROLLMENT_PASSWORD = SECURE_BOOT_KEY_URL = + +################### +# Hidden vars + # Cache DNF_CACHE = - PACKAGE_MANAGER = dnf # Functions diff --git a/tests/repo/vars.sh b/tests/repo/vars.sh new file mode 100644 index 0000000..e9867bf --- /dev/null +++ b/tests/repo/vars.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +vars=() + +while read -r line +do + if ! [[ $line =~ ^# ]] + then + vars+=$(echo $line | cut -d= -f1 | tr [:upper:] [:lower:]) + fi + if [[ $line =~ ^########## ]] + then + break + fi +done < Makefile + +result=0 + +for var in $vars +do + grep "^| ${var}" README.md > /dev/null + if [[ $? != 0 ]] + then + echo "$var not found in README.md" + result=1 + fi +done + +for var in $vars +do + grep "^ ${var}:" action.yml > /dev/null + if [[ $? != 0 ]] + then + echo "$var not found in action.yml" + result=1 + fi +done \ No newline at end of file