#!/usr/bin/make -f

export DH_GOLANG_INSTALL_EXTRA := test

%:
	dh $@ --buildsystem=golang

override_dh_auto_install:
	dh_auto_install -- --no-binaries

execute_after_dh_auto_install:
	find . \( -name '*.sif' -o -name 'gen_sifs.go' \) -print | xargs chmod -v -x

# https://github.com/apptainer/sif/issues/306
# Too modern sigstore-sigstore trigger this:
# === RUN   Test_dsseDecoder_verifyMessage/CorruptPayloadType
#     dsse_test.go:353: got error dsse: verify envelope failed: dsse: unexpected payload type: got "bad", want "application/vnd.sylabs.sif-metadata+json", want unexpected DSSE
#  payload type
#     dsse_test.go:361: got keys []crypto.PublicKey(nil), want []crypto.PublicKey{(*rsa.PublicKey)(0x1c5ccc4a6b20)}
#     --- FAIL: Test_dsseDecoder_verifyMessage/CorruptPayloadType (0.01s)
SKIP=Test_dsseDecoder_verifyMessage/CorruptPayloadType
override_dh_auto_test:
	-dh_auto_test $(DH_BUILD_OPTS) -- -run=$(SKIP)
	dh_auto_test $(DH_BUILD_OPTS) -- -skip=$(SKIP)
