From d2889678a403e66ba234ed53f28d2ea7a097edf1 Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Thu, 14 Sep 2023 00:32:52 -0700 Subject: [PATCH] ci: Fix broken main (#52) CI on main is currently broken for several reasons: - The Makefile wasn't Windows friendly. - Some of the documentation had broken links. - Some of the documentation was poorly formatted. - Windows support is broken. All but the last issue has been fixed by this PR. We're dropping Windows support for now. Two follow-ups were created: #53, #54 --- .github/workflows/ci.yml | 2 +- CONTRIBUTING.md | 3 ++- Makefile | 15 ++++++++++----- docs/.mdox-validate.yaml | 4 ++++ docs/get-started/flow.md | 1 - 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2de8356..bc7c216 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: ["ubuntu-latest", "windows-latest"] + os: ["ubuntu-latest"] go: ["1.18.x", "1.19.x"] include: - go: 1.19.x diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0009324..c05b57d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,7 +28,8 @@ feel free to [start a new discussion](https://github.com/uber-go/cff/discussions instead and we'll assist you if we can. ## Contributing Code -Before contributing code, please follow [these steps](#new-functionality). + +Before contributing code, please follow [these steps](#contributing-ideas). When your feature is accepted by maintainers, follow these steps: diff --git a/Makefile b/Makefile index dfb6b89..a0f1de8 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,18 @@ -export GOBIN = $(shell pwd)/bin +SHELL = /bin/bash + +# Cross-platform way to find the directory holding this Makefile. +PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) + +export GOBIN = $(PROJECT_ROOT)/bin export PATH := $(GOBIN):$(PATH) MODULES ?= . ./examples ./internal/tests ./tools ./docs TEST_FLAGS ?= -race -CFF = $(GOBIN)/cff -MOCKGEN = $(GOBIN)/mockgen -STATICCHECK = $(GOBIN)/staticcheck -MDOX = $(GOBIN)/mdox +CFF = bin/cff +MOCKGEN = bin/mockgen +STATICCHECK = bin/staticcheck +MDOX = bin/mdox # 'make cover' should not run on docs by default. # We run that separately explicitly on a specific platform. diff --git a/docs/.mdox-validate.yaml b/docs/.mdox-validate.yaml index b32f700..0dd8592 100644 --- a/docs/.mdox-validate.yaml +++ b/docs/.mdox-validate.yaml @@ -8,3 +8,7 @@ validators: type: 'githubPullsIssues' - regex: '(^http[s]?:\/\/)(www\.)?(github\.com\/)uber-go\/cff(\/discussions\/)' type: 'ignore' + + # Ignore pkg.go.dev links until release. + - regex: '(^http[s]?:\/\/)(pkg\.)?(go\.dev\/)' + type: 'ignore' diff --git a/docs/get-started/flow.md b/docs/get-started/flow.md index de44a1b..a3c157a 100644 --- a/docs/get-started/flow.md +++ b/docs/get-started/flow.md @@ -261,7 +261,6 @@ Now let's actually make requests to this interface. fmt.Println(res.Driver, "drove", res.Rider, "who lives in", res.HomeCity) ``` - 15. Finally, run `go generate` again. You should see a message similar to the following.