mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
split tests and verify vars are listed
This commit is contained in:
parent
ab71d0a291
commit
e1a26498c4
4 changed files with 102 additions and 7 deletions
43
.github/workflows/build-and-test.yml
vendored
43
.github/workflows/build-and-test.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
24
.github/workflows/variables.yml
vendored
Normal file
24
.github/workflows/variables.yml
vendored
Normal file
|
|
@ -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
|
||||
5
Makefile
5
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
|
||||
|
|
|
|||
37
tests/repo/vars.sh
Normal file
37
tests/repo/vars.sh
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue