Skip to content

Commit

Permalink
workflow: ensure "make test" builds externals and use in workflow
Browse files Browse the repository at this point in the history
This commit ensures that externals are build during the tests and
that the GH action will test with externals too.

This is slightly hacky as it requires the network. Eventually we
can pull in externals via build-deps or vendor them but for now
this unblocks the otk work.
  • Loading branch information
mvo5 committed Sep 9, 2024
1 parent ce89208 commit 2924d6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
python -m pip install --upgrade pip
pip install .[dev]
- name: Run unit tests
run: PYTHONPATH=./src pytest
run: PYTHONPATH=./src make test
- name: Validate OTK configuration
run: |
for f in example/*/*.yaml; do
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ format:
@find src test -name '*.py' | xargs autopep8 --in-place

.PHONY: test
test:
test: external
@pytest

.PHONY: push-check
Expand Down Expand Up @@ -60,12 +60,14 @@ rpm: git-diff-check $(RPM_SPECFILE) $(RPM_TARBALL)
# Note that "external" will most likely in the future build from internal
# sources instead of pulling of the network
.PHONY: external
# # Keep this in sync with e.g. https://github.com/containers/podman/blob/2981262215f563461d449b9841741339f4d9a894/Makefile#L51
CONTAINERS_STORAGE_THIN_TAGS=containers_image_openpgp exclude_graphdriver_btrfs exclude_graphdriver_devicemapper
IMAGES_REF ?= github.com/osbuild/images
external:
mkdir -p "$(SRCDIR)/external"
for otk_cmd in gen-partition-table \
make-fstab-stage \
make-partition-mounts-devices \
make-partition-stages; do \
GOBIN="$(SRCDIR)/external" go install "$(IMAGES_REF)"/cmd/otk-$${otk_cmd}@latest ; \
GOBIN="$(SRCDIR)/external" go install -tags "$(CONTAINERS_STORAGE_THIN_TAGS)" "$(IMAGES_REF)"/cmd/otk-$${otk_cmd}@latest ; \
done

0 comments on commit 2924d6e

Please sign in to comment.