2025-12-12 15:42:25 +01:00
|
|
|
.PHONY: install uninstall \
|
|
|
|
|
build build-no-cache build-no-cache-all build-missing \
|
|
|
|
|
delete-volumes purge \
|
|
|
|
|
test test-unit test-e2e test-integration test-env-virtual test-env-nix \
|
2026-07-27 15:25:19 +02:00
|
|
|
lint \
|
2025-12-12 15:42:25 +01:00
|
|
|
setup setup-venv setup-nix
|
2025-12-05 19:32:42 +01:00
|
|
|
|
Refactor CI distro handling and container build scripts
- Introduce a GitHub Actions matrix for `test-container` and `test-e2e`
to run against arch, debian, ubuntu, fedora, and centos
- Run unit and integration tests only in the Arch container by passing
`distro="arch"` via make in the corresponding workflows
- Replace the global DISTROS loop with a single `distro` variable in
the Makefile, defaulting to `arch`, and export it for all scripts
- Update build scripts (build-image, build-image-no-cache, build-image-missing)
to build images for the selected distro only
- Simplify test-container script to validate a single distro image using
the `distro` environment variable
- Simplify E2E, unit, and integration test scripts to run against a
single distro container instead of iterating over all distros
https://chatgpt.com/share/693acbba-9e30-800f-94fb-fea4489e9078
2025-12-11 14:48:36 +01:00
|
|
|
# Distro
|
|
|
|
|
# Options: arch debian ubuntu fedora centos
|
2025-12-12 12:15:40 +01:00
|
|
|
DISTROS ?= arch debian ubuntu fedora centos
|
2025-12-13 15:05:34 +01:00
|
|
|
PKGMGR_DISTRO ?= arch
|
|
|
|
|
export PKGMGR_DISTRO
|
Refactor CI distro handling and container build scripts
- Introduce a GitHub Actions matrix for `test-container` and `test-e2e`
to run against arch, debian, ubuntu, fedora, and centos
- Run unit and integration tests only in the Arch container by passing
`distro="arch"` via make in the corresponding workflows
- Replace the global DISTROS loop with a single `distro` variable in
the Makefile, defaulting to `arch`, and export it for all scripts
- Update build scripts (build-image, build-image-no-cache, build-image-missing)
to build images for the selected distro only
- Simplify test-container script to validate a single distro image using
the `distro` environment variable
- Simplify E2E, unit, and integration test scripts to run against a
single distro container instead of iterating over all distros
https://chatgpt.com/share/693acbba-9e30-800f-94fb-fea4489e9078
2025-12-11 14:48:36 +01:00
|
|
|
|
2025-12-17 22:53:21 +01:00
|
|
|
# Nix Config Variable (To avoid rate limit)
|
2025-12-17 23:17:34 +01:00
|
|
|
NIX_CONFIG ?=
|
2025-12-17 22:53:21 +01:00
|
|
|
export NIX_CONFIG
|
|
|
|
|
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
Refactor CI distro handling and container build scripts
- Introduce a GitHub Actions matrix for `test-container` and `test-e2e`
to run against arch, debian, ubuntu, fedora, and centos
- Run unit and integration tests only in the Arch container by passing
`distro="arch"` via make in the corresponding workflows
- Replace the global DISTROS loop with a single `distro` variable in
the Makefile, defaulting to `arch`, and export it for all scripts
- Update build scripts (build-image, build-image-no-cache, build-image-missing)
to build images for the selected distro only
- Simplify test-container script to validate a single distro image using
the `distro` environment variable
- Simplify E2E, unit, and integration test scripts to run against a
single distro container instead of iterating over all distros
https://chatgpt.com/share/693acbba-9e30-800f-94fb-fea4489e9078
2025-12-11 14:48:36 +01:00
|
|
|
# Base images
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
refactor(docker): consume the base images instead of building them
The `virgin` stage installed the distribution build dependencies, and that
layer now lives in its own repository:
https://github.com/kevinveenbirkenbach/base-images. What remains here is one
image per distribution that installs pkgmgr on top of it. `slim` goes with it:
it was published for every distribution and pulled by nothing.
scripts/build/base.sh stops pinning five upstream images and resolves
ghcr.io/<owner>/base-<distro>:<tag> instead. Its env names follow the images
repository rather than this one, so the code shows whose namespace that is.
image.sh loses the --target axis, the -virgin/-slim tag suffixes with it, and
passes --platform on push. Manjaro joins the set; os_resolver.sh already maps
it onto arch, so it needs no dependency script of its own.
The two virgin workflows pull the base image rather than building it. What
they prove is unchanged: pkgmgr installs into an untouched container, as root
and as an unprivileged user.
test_distro_dependency_scripts_install_gpg_tools goes: it grepped the
dependency scripts for gnupg, and those scripts are base-images' responsibility
now, where the contract test runs `gpg --version` instead of reading a package
list.
Verified against locally built base images: the arch image builds FROM
base-arch, and the full suite passes inside it - 405 unit, 90 integration and
49 e2e tests.
Requires base-images to be published first; until then every build here fails
at the pull.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 15:51:25 +02:00
|
|
|
BASE_IMAGES_TAG ?= latest
|
|
|
|
|
export BASE_IMAGES_TAG
|
2025-12-08 00:24:22 +01:00
|
|
|
|
2025-12-09 17:53:10 +01:00
|
|
|
# PYthon Unittest Pattern
|
|
|
|
|
TEST_PATTERN := test_*.py
|
|
|
|
|
export TEST_PATTERN
|
2025-12-12 22:59:46 +01:00
|
|
|
export PYTHONPATH := src
|
2025-12-09 17:53:10 +01:00
|
|
|
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-12 15:42:25 +01:00
|
|
|
# System install
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-12 15:42:25 +01:00
|
|
|
install:
|
|
|
|
|
@echo "Building and installing distro-native package-manager for this system..."
|
2025-12-12 21:30:03 +01:00
|
|
|
@bash scripts/installation/init.sh
|
2025-04-01 15:37:07 +02:00
|
|
|
|
2025-12-12 15:42:25 +01:00
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
# PKGMGR setup
|
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
# Default: keep current auto-detection behavior
|
2025-12-14 12:26:50 +01:00
|
|
|
setup: setup-venv
|
2025-12-12 15:42:25 +01:00
|
|
|
|
2025-12-12 22:59:46 +01:00
|
|
|
# Explicit: developer setup (Python venv + shell RC + install)
|
2025-12-12 18:07:25 +01:00
|
|
|
setup-venv: setup-nix
|
2025-12-12 15:42:25 +01:00
|
|
|
@bash scripts/setup/venv.sh
|
|
|
|
|
|
|
|
|
|
# Explicit: Nix shell mode (no venv, no RC changes)
|
|
|
|
|
setup-nix:
|
|
|
|
|
@bash scripts/setup/nix.sh
|
|
|
|
|
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-09 05:31:55 +01:00
|
|
|
# Docker build targets (delegated to scripts/build)
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-12 12:15:40 +01:00
|
|
|
build:
|
2025-12-12 16:40:21 +01:00
|
|
|
@bash scripts/build/image.sh
|
|
|
|
|
|
refactor(docker): consume the base images instead of building them
The `virgin` stage installed the distribution build dependencies, and that
layer now lives in its own repository:
https://github.com/kevinveenbirkenbach/base-images. What remains here is one
image per distribution that installs pkgmgr on top of it. `slim` goes with it:
it was published for every distribution and pulled by nothing.
scripts/build/base.sh stops pinning five upstream images and resolves
ghcr.io/<owner>/base-<distro>:<tag> instead. Its env names follow the images
repository rather than this one, so the code shows whose namespace that is.
image.sh loses the --target axis, the -virgin/-slim tag suffixes with it, and
passes --platform on push. Manjaro joins the set; os_resolver.sh already maps
it onto arch, so it needs no dependency script of its own.
The two virgin workflows pull the base image rather than building it. What
they prove is unchanged: pkgmgr installs into an untouched container, as root
and as an unprivileged user.
test_distro_dependency_scripts_install_gpg_tools goes: it grepped the
dependency scripts for gnupg, and those scripts are base-images' responsibility
now, where the contract test runs `gpg --version` instead of reading a package
list.
Verified against locally built base images: the arch image builds FROM
base-arch, and the full suite passes inside it - 405 unit, 90 integration and
49 e2e tests.
Requires base-images to be published first; until then every build here fails
at the pull.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 15:51:25 +02:00
|
|
|
build-missing:
|
2025-12-12 16:40:21 +01:00
|
|
|
@bash scripts/build/image.sh --missing
|
2025-12-12 12:15:40 +01:00
|
|
|
|
2025-12-05 22:33:49 +01:00
|
|
|
build-no-cache:
|
2025-12-12 16:40:21 +01:00
|
|
|
@bash scripts/build/image.sh --no-cache
|
2025-12-05 22:33:49 +01:00
|
|
|
|
2025-12-12 12:15:40 +01:00
|
|
|
build-no-cache-all:
|
|
|
|
|
@set -e; \
|
|
|
|
|
for d in $(DISTROS); do \
|
|
|
|
|
echo "=== build-no-cache: $$d ==="; \
|
2025-12-13 14:34:15 +01:00
|
|
|
PKGMGR_DISTRO="$$d" $(MAKE) build-no-cache; \
|
2025-12-12 12:15:40 +01:00
|
|
|
done
|
2025-12-08 13:35:20 +01:00
|
|
|
|
2026-07-27 15:25:19 +02:00
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
# Lint targets (run on the host, not in a container)
|
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
lint:
|
|
|
|
|
@bash scripts/lint/python.sh
|
|
|
|
|
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-09 05:31:55 +01:00
|
|
|
# Test targets (delegated to scripts/test)
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-08 01:40:36 +01:00
|
|
|
|
Refactor CI workflows and Makefile to unify container builds and simplify test execution
This commit updates all GitHub Actions workflows and the Makefile to ensure
consistent behavior across unit, integration, end-to-end, and OS-container
tests.
Changes include:
CI Workflows:
- Rename workflows for clearer, more professional naming:
* "Test Distribution Containers" → "Test OS Containers"
* "Test package-manager (e2e)" → "Test End-To-End"
* "Test package-manager (unit)" → "Test Units"
* "Test package-manager (integration)" → "Test Code Integration"
- Remove explicit build steps from workflows; container creation is now
delegated to the Makefile via build-missing.
- Restrict test jobs to only build the Arch test container by setting:
DISTROS="arch"
Makefile:
- Add build-missing as a dependency to all test targets:
test-unit, test-integration, test-e2e, test-container
- Remove redundant build-missing call from the combined 'test' target,
since Make now ensures build-missing runs exactly once per invocation.
- Preserve existing target structure while ensuring container images are
built automatically on demand.
This makes the CI pipeline faster, more predictable, and removes duplicated
container build logic. All tests now use the same unified mechanism for
building missing images.
2025-12-09 16:18:15 +01:00
|
|
|
test-unit: build-missing
|
2025-12-10 21:09:18 +01:00
|
|
|
@bash scripts/test/test-unit.sh
|
2025-12-08 01:40:36 +01:00
|
|
|
|
Refactor CI workflows and Makefile to unify container builds and simplify test execution
This commit updates all GitHub Actions workflows and the Makefile to ensure
consistent behavior across unit, integration, end-to-end, and OS-container
tests.
Changes include:
CI Workflows:
- Rename workflows for clearer, more professional naming:
* "Test Distribution Containers" → "Test OS Containers"
* "Test package-manager (e2e)" → "Test End-To-End"
* "Test package-manager (unit)" → "Test Units"
* "Test package-manager (integration)" → "Test Code Integration"
- Remove explicit build steps from workflows; container creation is now
delegated to the Makefile via build-missing.
- Restrict test jobs to only build the Arch test container by setting:
DISTROS="arch"
Makefile:
- Add build-missing as a dependency to all test targets:
test-unit, test-integration, test-e2e, test-container
- Remove redundant build-missing call from the combined 'test' target,
since Make now ensures build-missing runs exactly once per invocation.
- Preserve existing target structure while ensuring container images are
built automatically on demand.
This makes the CI pipeline faster, more predictable, and removes duplicated
container build logic. All tests now use the same unified mechanism for
building missing images.
2025-12-09 16:18:15 +01:00
|
|
|
test-integration: build-missing
|
2025-12-10 21:09:18 +01:00
|
|
|
@bash scripts/test/test-integration.sh
|
2025-12-08 11:43:39 +01:00
|
|
|
|
Refactor CI workflows and Makefile to unify container builds and simplify test execution
This commit updates all GitHub Actions workflows and the Makefile to ensure
consistent behavior across unit, integration, end-to-end, and OS-container
tests.
Changes include:
CI Workflows:
- Rename workflows for clearer, more professional naming:
* "Test Distribution Containers" → "Test OS Containers"
* "Test package-manager (e2e)" → "Test End-To-End"
* "Test package-manager (unit)" → "Test Units"
* "Test package-manager (integration)" → "Test Code Integration"
- Remove explicit build steps from workflows; container creation is now
delegated to the Makefile via build-missing.
- Restrict test jobs to only build the Arch test container by setting:
DISTROS="arch"
Makefile:
- Add build-missing as a dependency to all test targets:
test-unit, test-integration, test-e2e, test-container
- Remove redundant build-missing call from the combined 'test' target,
since Make now ensures build-missing runs exactly once per invocation.
- Preserve existing target structure while ensuring container images are
built automatically on demand.
This makes the CI pipeline faster, more predictable, and removes duplicated
container build logic. All tests now use the same unified mechanism for
building missing images.
2025-12-09 16:18:15 +01:00
|
|
|
test-e2e: build-missing
|
2025-12-09 05:31:55 +01:00
|
|
|
@bash scripts/test/test-e2e.sh
|
2025-12-08 00:24:22 +01:00
|
|
|
|
2025-12-12 12:15:40 +01:00
|
|
|
test-env-virtual: build-missing
|
|
|
|
|
@bash scripts/test/test-env-virtual.sh
|
|
|
|
|
|
|
|
|
|
test-env-nix: build-missing
|
|
|
|
|
@bash scripts/test/test-env-nix.sh
|
|
|
|
|
|
2026-07-27 15:25:19 +02:00
|
|
|
# Combined test target for local + CI (lint + unit + integration + e2e)
|
|
|
|
|
test: lint test-env-virtual test-unit test-integration test-e2e
|
2025-04-27 22:38:52 +02:00
|
|
|
|
2025-12-11 15:29:51 +01:00
|
|
|
delete-volumes:
|
2025-12-13 14:34:15 +01:00
|
|
|
@docker volume rm "pkgmgr_nix_store_${PKGMGR_DISTRO}" "pkgmgr_nix_cache_${PKGMGR_DISTRO}" || echo "No volumes to delete."
|
2025-12-11 15:29:51 +01:00
|
|
|
|
|
|
|
|
purge: delete-volumes build-no-cache
|
|
|
|
|
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
# Uninstall target
|
|
|
|
|
# ------------------------------------------------------------
|
2025-04-27 22:38:52 +02:00
|
|
|
uninstall:
|
2025-12-09 05:31:55 +01:00
|
|
|
@bash scripts/uninstall.sh
|