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
2 changes: 1 addition & 1 deletion .github/actions/setup-go-tools/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ runs:
if: inputs.gomoddownload == 'true' && steps.go-setup.outputs.cache-hit != 'true'
shell: bash
working-directory: ${{ inputs.repo-path }}
run: make -j2 gomoddownload
run: make -j8 gomoddownload
28 changes: 27 additions & 1 deletion .github/workflows/build-and-test-experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,26 @@ jobs:
strategy:
fail-fast: false
matrix:
# codegen is split across the standard module groups so the slowest
# shard bounds wall time. Each codegen-<group> shard runs
# `make generate GROUP=<group>` over only that subset.
shard:
- codegen
- codegen-receiver-0
- codegen-receiver-1
- codegen-receiver-2
- codegen-receiver-3
- codegen-processor-0
- codegen-processor-1
- codegen-exporter-0
- codegen-exporter-1
- codegen-exporter-2
- codegen-exporter-3
- codegen-extension
- codegen-connector
- codegen-internal
- codegen-pkg
- codegen-cmd-0
- codegen-other
- porto-and-gci
- go-mod-hygiene
- small-generators
Expand All @@ -233,6 +251,11 @@ jobs:
- uses: ./.github/actions/setup-go-tools
with:
go-version: oldstable
# read-only-checks only runs checkdoc/checkmetadata/checkapi/
# multimod-verify. genotelcontribcol below still pulls what it
# actually needs lazily, but bulk-downloading every module up
# front isn't required.
gomoddownload: ${{ matrix.shard == 'read-only-checks' && 'false' || 'true' }}
- run: make genotelcontribcol
- name: Run shard ${{ matrix.shard }}
run: ./.github/workflows/scripts/run-checks-shard.sh "${{ matrix.shard }}"
Expand Down Expand Up @@ -522,6 +545,9 @@ jobs:
- uses: ./.github/actions/setup-go-tools
with:
go-version: oldstable
# Only a handful of modules build here; let `go build` fetch what it
# needs lazily rather than pre-downloading every module in the repo.
gomoddownload: "false"
- name: Build affected modules for ${{ matrix.os }}/${{ matrix.arch }}${{ matrix.arm && format('v{0}', matrix.arm) || '' }}
env:
MATRIX: ${{ needs.exp-ci-scope.outputs.matrix }}
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/scripts/run-checks-shard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ set -euo pipefail
# ./run-checks-shard.sh <shard-name>
#
# Shards:
# codegen -- `make generate` + git-clean check
# codegen-<group> -- `make generate GROUP=<group>` + git-clean check.
# <group> is one of the standard module groups
# (receiver-0, processor-1, exporter-2, extension,
# connector, internal, pkg, cmd-0, other, ...).
# porto-and-gci -- goporto + gogci (both write to source files)
# go-mod-hygiene -- crosslink + tidylist + gotidy (all touch go.mod/go.sum)
# small-generators -- gendistributions + genlabels + gencodecov
Expand All @@ -35,10 +38,11 @@ fi
shard="$1"

case "${shard}" in
codegen)
make generate
codegen-*)
group="${shard#codegen-}"
make generate GROUP="${group}"
if [[ -n $(git status -s) ]]; then
echo 'Generated code is out of date, please run "make generate" and commit the changes in this PR.'
echo "Generated code is out of date for group '${group}', please run \"make generate\" and commit the changes in this PR."
exit 1
fi
;;
Expand Down Expand Up @@ -81,7 +85,7 @@ case "${shard}" in
;;
*)
echo "Unknown shard: ${shard}" >&2
echo "Known shards: codegen porto-and-gci go-mod-hygiene small-generators schemas-and-templates read-only-checks" >&2
echo "Known shards: codegen-<group> porto-and-gci go-mod-hygiene small-generators schemas-and-templates read-only-checks" >&2
exit 2
;;
esac
4 changes: 4 additions & 0 deletions Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,13 @@ mdatagen:
.PHONY: generate
generate:
ifeq ($(CURDIR),$(SRC_ROOT))
ifeq ($(GROUP),)
$(MAKE) for-all CMD="$(GOCMD) generate ./..."
$(MAKE) gofmt
$(MAKE) gogci
else
$(MAKE) $(FOR_GROUP_TARGET) TARGET=generate
endif
else
$(GOCMD) generate ./...
$(MAKE) fmt
Expand Down
Loading