Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/zz_generated.nested_go_modules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# devctl
#
# https://github.com/giantswarm/devctl/blob/c189ac5af54ac0238ae2dcd7d4710aba69d5f19e/pkg/gen/input/workflows/internal/file/nested_go_modules.yaml.template
# https://github.com/giantswarm/devctl/blob/f9c2d107c2e3284ef768572705a8a33935b897bd/pkg/gen/input/workflows/internal/file/nested_go_modules.yaml.template
#

name: Nested Go modules
Expand Down Expand Up @@ -86,8 +86,26 @@ jobs:
set -euo pipefail
go mod tidy
git diff --exit-code -- go.mod go.sum
go test -short -race ./...
go vet ./...
# A tools-only module has no packages, and `go test` exits 1 with "no
# packages to test". Skip only that case, in either form: Go files behind
# the `tools` build tag with nothing else ignored, or `tool` directives in
# go.mod with no Go files in the build. Any other module, such as one whose code sits
# behind another build tag, still reaches go test and fails there.
skip=false
packages=$(go list ./...)
if [[ -z "$packages" ]]; then
tool_packages=$(go list -tags tools ./...)
ignored=$(go list -tags tools -f '{{.IgnoredGoFiles}}' ./... | tr -d '[] \n')
tool_directives=$(go mod edit -json | jq '(.Tool // []) | length')
if [[ -n "$tool_packages" && -z "$ignored" ]]; then skip=true; fi
if [[ "$tool_directives" != 0 && -z "$tool_packages" ]]; then skip=true; fi
fi
if [[ "$skip" == true ]]; then
echo "::notice::Tools-only module without packages, skipping go test and go vet."
else
go test -short -race ./...
go vet ./...
fi

release:
needs: [modules, test]
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog

The changes of each release are in its notes on GitHub Releases:
https://github.com/giantswarm/skill-manager/releases
<https://github.com/giantswarm/skill-manager/releases>

This file is not updated any more: a pull request does not edit it. The
pull request title is the release note.
Loading