Browse Source

Update CI config and Makefile for vendor removal

Now that vendor is removed our CI can check that 'go mod tidy' makes no changes, instad of
checking vendor/modules.txt
pull/10672/head
Daniel Nephin 3 years ago
parent
commit
a318ca38cf
  1. 18
      .circleci/config.yml
  2. 8
      GNUmakefile

18
.circleci/config.yml

@ -150,16 +150,14 @@ jobs:
command: *lintcmd command: *lintcmd
- run: *notify-slack-failure - run: *notify-slack-failure
# checks vendor directory is correct check-go-mod:
check-vendor:
docker: docker:
- image: *GOLANG_IMAGE - image: *GOLANG_IMAGE
environment: environment:
<<: *ENVIRONMENT <<: *ENVIRONMENT
steps: steps:
- checkout - checkout
- run: - run: go mod tidy
command: make update-vendor
- run: | - run: |
if [[ -n $(git status -s) ]]; then if [[ -n $(git status -s) ]]; then
echo "Git directory has changes" echo "Git directory has changes"
@ -989,7 +987,7 @@ workflows:
go-tests: go-tests:
unless: << pipeline.parameters.trigger-load-test >> unless: << pipeline.parameters.trigger-load-test >>
jobs: jobs:
- check-vendor: &filter-ignore-non-go-branches - check-go-mod: &filter-ignore-non-go-branches
filters: filters:
branches: branches:
ignore: ignore:
@ -1032,12 +1030,12 @@ workflows:
build-distros: build-distros:
unless: << pipeline.parameters.trigger-load-test >> unless: << pipeline.parameters.trigger-load-test >>
jobs: jobs:
- check-vendor: *filter-ignore-non-go-branches - check-go-mod: *filter-ignore-non-go-branches
- build-386: &require-check-vendor - build-386: &require-check-go-mod
requires: requires:
- check-vendor - check-go-mod
- build-amd64: *require-check-vendor - build-amd64: *require-check-go-mod
- build-arm: *require-check-vendor - build-arm: *require-check-go-mod
# every commit on main will have a rebuilt UI # every commit on main will have a rebuilt UI
- frontend-cache: - frontend-cache:
filters: filters:

8
GNUmakefile

@ -199,14 +199,6 @@ go-mod-tidy:
@cd api && go mod tidy @cd api && go mod tidy
@go mod tidy @go mod tidy
update-vendor: go-mod-tidy
@echo "--> Running go mod vendor"
@go mod vendor
@echo "--> Removing vendoring of our own nested modules"
@rm -rf vendor/github.com/hashicorp/consul
@grep -v "hashicorp/consul/" < vendor/modules.txt > vendor/modules.txt.new
@mv vendor/modules.txt.new vendor/modules.txt
test-internal: test-internal:
@echo "--> Running go test" @echo "--> Running go test"
@rm -f test.log exit-code @rm -f test.log exit-code

Loading…
Cancel
Save