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 \
|
|
|
|
|
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-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-09 05:31:55 +01:00
|
|
|
# (kept for documentation/reference; actual build logic is in scripts/build)
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-09 05:31:55 +01:00
|
|
|
BASE_IMAGE_ARCH := archlinux:latest
|
|
|
|
|
BASE_IMAGE_DEBIAN := debian:stable-slim
|
|
|
|
|
BASE_IMAGE_UBUNTU := ubuntu:latest
|
|
|
|
|
BASE_IMAGE_FEDORA := fedora:latest
|
|
|
|
|
BASE_IMAGE_CENTOS := quay.io/centos/centos:stream9
|
2025-12-08 00:24:22 +01:00
|
|
|
|
2025-12-09 05:31:55 +01:00
|
|
|
# Make them available in scripts
|
|
|
|
|
export BASE_IMAGE_ARCH
|
|
|
|
|
export BASE_IMAGE_DEBIAN
|
|
|
|
|
export BASE_IMAGE_UBUNTU
|
|
|
|
|
export BASE_IMAGE_FEDORA
|
|
|
|
|
export BASE_IMAGE_CENTOS
|
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
|
|
|
|
|
setup: setup-nix setup-venv
|
|
|
|
|
|
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 --target virgin
|
|
|
|
|
@bash scripts/build/image.sh
|
|
|
|
|
|
2025-12-12 18:07:25 +01:00
|
|
|
build-missing-virgin:
|
2025-12-12 16:40:21 +01:00
|
|
|
@bash scripts/build/image.sh --target virgin --missing
|
2025-12-12 18:07:25 +01:00
|
|
|
|
|
|
|
|
build-missing: build-missing-virgin
|
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 --target virgin --no-cache
|
|
|
|
|
@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
|
|
|
|
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
|
|
|
|
|
|
2025-12-10 16:57:02 +01:00
|
|
|
# Combined test target for local + CI (unit + integration + e2e)
|
2025-12-12 12:15:40 +01:00
|
|
|
test: 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
|