Repository navigation
Add GitHub Actions checks, test script, and skip-main flag to uki-setup #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
GlitchSlayed
merged 1 commit into
main
from
codex/add-checks-with-fedora-container-in-gh-vjbaw2
Mar 7, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: checks | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| fedora-checks: | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: fedora:43 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install check dependencies | ||
| run: | | ||
| dnf install -y \ | ||
| bash \ | ||
| coreutils \ | ||
| diffutils \ | ||
| findutils \ | ||
| grep \ | ||
| sed \ | ||
| util-linux \ | ||
| which \ | ||
| shellcheck | ||
|
|
||
| - name: Bash syntax checks | ||
| run: bash -n uki-setup.sh tests/test_uki_setup.sh | ||
|
|
||
| - name: ShellCheck | ||
| run: shellcheck -P . uki-setup.sh tests/test_uki_setup.sh | ||
|
|
||
| - name: Project checks | ||
| run: bash tests/test_uki_setup.sh |
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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | ||
| cd "$REPO_ROOT" | ||
|
|
||
| TMPDIR_WORK="$(mktemp -d)" | ||
| cleanup() { | ||
| rm -rf "$TMPDIR_WORK" | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| export UKI_SETUP_SKIP_MAIN=1 | ||
| # shellcheck source=uki-setup.sh | ||
| source "$REPO_ROOT/uki-setup.sh" | ||
|
|
||
| BUILD_SCRIPT="$TMPDIR_WORK/usr-local-sbin-uki-build.sh" | ||
| INSTALL_PLUGIN="$TMPDIR_WORK/usr-lib-kernel-install.d-90-uki-dracut.install" | ||
| BACKUP_ROOT="$TMPDIR_WORK/backups" | ||
| EFI_DIR="$TMPDIR_WORK/esp/EFI/Linux" | ||
| CMDLINE="root=UUID=test-uuid rw quiet" | ||
| AUTO_DETECT_CMDLINE=0 | ||
| EFI_STUB="/usr/lib/systemd/boot/efi/linuxx64.efi.stub" | ||
|
|
||
| phase_write_build_script | ||
|
|
||
| [[ -x "$BUILD_SCRIPT" ]] || { | ||
| echo "Expected build script to be executable at $BUILD_SCRIPT" | ||
| exit 1 | ||
| } | ||
|
|
||
| if grep -q '__EFI_DIR__\|__CMDLINE__\|__AUTO_DETECT_CMDLINE__\|__EFI_STUB__' "$BUILD_SCRIPT"; then | ||
| echo "Template placeholders were not fully substituted in build script" | ||
| exit 1 | ||
| fi | ||
|
|
||
| grep -q "EFI_DIR=\"$EFI_DIR\"" "$BUILD_SCRIPT" | ||
| grep -q "CMDLINE=\"$CMDLINE\"" "$BUILD_SCRIPT" | ||
| grep -q 'AUTO_DETECT_CMDLINE=0' "$BUILD_SCRIPT" | ||
| grep -q "EFI_STUB=\"$EFI_STUB\"" "$BUILD_SCRIPT" | ||
|
|
||
| phase_write_plugin | ||
|
|
||
| [[ -x "$INSTALL_PLUGIN" ]] || { | ||
| echo "Expected install plugin to be executable at $INSTALL_PLUGIN" | ||
| exit 1 | ||
| } | ||
|
|
||
| grep -q "BUILD_SCRIPT=\"$BUILD_SCRIPT\"" "$INSTALL_PLUGIN" | ||
| grep -Fq "UKI=\"${EFI_DIR}/linux-\${KERNEL_VER}.efi\"" "$INSTALL_PLUGIN" | ||
|
|
||
| echo "All local UKI setup checks passed." |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
UKI_SETUP_SKIP_MAINguard uses-ne, which triggers arithmetic evaluation underset -u; if a caller setsUKI_SETUP_SKIP_MAINto a common string boolean liketrue/false, Bash treats that token as a variable name and exits with an unbound-variable error before any phase runs. This makes the script unexpectedly fail in automation environments that pass string-valued env flags instead of numeric0/1.Useful? React with 👍 / 👎.