mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
test: relocate logic for creating test-report.pdf from workflow
It should be possible to create test reports manually, so logically the GitHub workflow should call a make rule in test.mk Untested: branding, or any case where Infix is used as a BR2_EXTERNAL Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -39,7 +39,7 @@ env:
|
||||
jobs:
|
||||
test:
|
||||
name: Regression Test ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.name || inputs.name }} ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target || inputs.target }}
|
||||
runs-on: [ self-hosted, regression ]
|
||||
runs-on: [self-hosted, regression]
|
||||
steps:
|
||||
- name: Checkout infix repo
|
||||
uses: actions/checkout@v4
|
||||
@@ -87,7 +87,7 @@ jobs:
|
||||
fi
|
||||
make test
|
||||
|
||||
- name: Publish Test Result for ${{ env.TARGET }}
|
||||
- name: Publish Test Result for ${{ env.TARGET }}
|
||||
# Ensure this runs even if Regression Test fails
|
||||
if: always()
|
||||
run: cat $TEST_PATH/.log/last/result-gh.md >> $GITHUB_STEP_SUMMARY
|
||||
@@ -96,15 +96,10 @@ jobs:
|
||||
# Ensure this runs even if Regression Test fails
|
||||
if: always()
|
||||
run: |
|
||||
asciidoctor-pdf \
|
||||
--theme $TEST_PATH/9pm/report/theme.yml \
|
||||
-a pdf-fontsdir=$TEST_PATH/9pm/report/fonts \
|
||||
$TEST_PATH/.log/last/report.adoc \
|
||||
-o $TEST_PATH/.log/last/report.pdf
|
||||
make test-dir="$(pwd)/$TEST_PATH" test-report
|
||||
|
||||
- name: Upload Test Report as Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-report
|
||||
path: ${{ env.TEST_PATH }}/.log/last/report.pdf
|
||||
|
||||
path: output/images/test-report.pdf
|
||||
|
||||
+15
-5
@@ -1,9 +1,10 @@
|
||||
base-dir := $(lastword $(subst :, ,$(BR2_EXTERNAL)))
|
||||
test-dir := $(BR2_EXTERNAL_INFIX_PATH)/test
|
||||
test-dir ?= $(BR2_EXTERNAL_INFIX_PATH)/test
|
||||
ninepm := $(BR2_EXTERNAL_INFIX_PATH)/test/9pm/9pm.py
|
||||
NINEPM_PROJ_CONF ?= $(BR2_EXTERNAL_INFIX_PATH)/test/9pm-proj.yaml
|
||||
spec-dir := $(test-dir)/spec
|
||||
test-specification := $(O)/images/test-specification.pdf
|
||||
|
||||
test-specification := $(BINARIES_DIR)/test-specification.pdf
|
||||
test-report := $(BINARIES_DIR)/test-report.pdf
|
||||
UNIT_TESTS ?= $(test-dir)/case/all-repo.yaml $(test-dir)/case/all-unit.yaml
|
||||
TESTS ?= $(test-dir)/case/all.yaml
|
||||
|
||||
@@ -33,9 +34,18 @@ test-sh:
|
||||
|
||||
test-spec:
|
||||
@esc_infix_name="$(echo $(INFIX_NAME) | sed 's/\//\\\//g')"; \
|
||||
sed 's/{REPLACE}/$(subst ",,$(esc_infix_name)) $(INFIX_VERSION)/' $(spec-dir)/Readme.adoc.in > $(spec-dir)/Readme.adoc
|
||||
sed 's/{REPLACE}/$(subst ",,$(esc_infix_name)) $(INFIX_VERSION)/' \
|
||||
$(spec-dir)/Readme.adoc.in > $(spec-dir)/Readme.adoc
|
||||
@$(spec-dir)/generate_spec.py -s $(test-dir)/case/all.yaml -r $(BR2_EXTERNAL_INFIX_PATH)
|
||||
@asciidoctor-pdf --failure-level INFO --theme $(spec-dir)/theme.yml -a pdf-fontsdir=$(spec-dir)/fonts -o $(test-specification) $(spec-dir)/Readme.adoc
|
||||
@asciidoctor-pdf --failure-level INFO --theme $(spec-dir)/theme.yml \
|
||||
-a pdf-fontsdir=$(spec-dir)/fonts \
|
||||
-o $(test-specification) $(spec-dir)/Readme.adoc
|
||||
|
||||
test-report:
|
||||
asciidoctor-pdf --theme $(spec-dir)/theme.yml \
|
||||
-a logo="image:$(LOGO)" \
|
||||
-a pdf-fontsdir=$(spec-dir)/fonts \
|
||||
-o $(test-report) $(test-dir)/.log/last/report.adoc
|
||||
|
||||
# Unit tests run with random (-r) hostname and container name to
|
||||
# prevent race conditions when running in CI environments.
|
||||
|
||||
Reference in New Issue
Block a user