Skip to content

Commit

Permalink
test: merge tests
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Kotzbauer <git@ckotzbauer.de>
  • Loading branch information
ckotzbauer committed Jun 16, 2022
1 parent 3764b74 commit 64b22fe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 151 deletions.
133 changes: 0 additions & 133 deletions .github/workflows/test-integration.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,24 @@ jobs:
run: make build

- name: Unit tests
env:
REGISTRY_USER: ckotzbauer
REGISTRY_TOKEN: ${{ secrets.GHCR_PASSWORD }}
run: |
make test
DATE="$(date +%Y%m%d%H%M%S)"
docker login -u "$REGISTRY_USER" -p "$REGISTRY_TOKEN" ghcr.io
docker build --build-arg date=${DATE} --context internal/target/oci/fixtures -t ghcr.io/ckotzbauer/sbom-operator/oci-test:${DATE} internal/target/oci/fixtures
docker push ghcr.io/ckotzbauer/sbom-operator/oci-test:${DATE}
DIGEST=$(docker inspect ghcr.io/ckotzbauer/sbom-operator/oci-test:${DATE} --format='{{index .RepoDigests 0}}')
syft registry:${DIGEST} -o json > internal/target/oci/fixtures/sbom.json
TEST_DIGEST="${DIGEST}" go test $(go list ./...) -coverprofile cover.out
COSIGN_REPOSITORY="ghcr.io/ckotzbauer/sbom-operator/oci-test" cosign download sbom ${DIGEST}
- uses: codecov/codecov-action@v3
with:
files: cover.out
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,3 @@ vet:

test:
go test $(shell go list ./... | grep -v sbom-operator/internal/target/oci) -coverprofile cover.out

test-integration:
bash internal/target/oci/fixtures/oci-test.sh $(REGISTRY_USER) $(REGISTRY_TOKEN)

14 changes: 0 additions & 14 deletions internal/target/oci/fixtures/oci-test.sh

This file was deleted.

0 comments on commit 64b22fe

Please sign in to comment.