Repository navigation
add github/graphql: announced GraphQL removals #122
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # The plugins build, are formatted and vetted, and their tests pass with the race | |
| # detector. Two guards keep plugins self-contained: | |
| # - imports: only this module, the standard library and the approved dependencies; | |
| # - network: net/http only in the fetch layer (core/fetch/, core/kit/, plugins/openapi/adapter/). | |
| # The steps are Makefile targets, so `make check` runs exactly this locally. | |
| # Until the Go code lands there is no go.mod, and every step after the first is skipped | |
| # with a notice, so the check passes. | |
| name: CI_go | |
| on: | |
| pull_request: | |
| merge_group: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| # A new push cancels the run it supersedes. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| go: | |
| name: go build, vet, gofmt, test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: is there Go code yet | |
| id: go | |
| run: | | |
| if [ -f go.mod ]; then | |
| echo "present=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "::notice::No go.mod yet: no Go packages to check. CI_go passes until the plugin code lands." | |
| echo "present=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - uses: actions/setup-go@v7 | |
| if: steps.go.outputs.present == 'true' | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| # Each step is a Makefile target; `make check` runs the same ones (plus | |
| # the internal-names check) locally. | |
| - name: go.mod and go.sum are tidy | |
| if: steps.go.outputs.present == 'true' | |
| run: make tidy | |
| - name: go build | |
| if: steps.go.outputs.present == 'true' | |
| run: make build | |
| - name: gofmt | |
| if: steps.go.outputs.present == 'true' | |
| run: make fmt | |
| - name: go vet | |
| if: steps.go.outputs.present == 'true' | |
| run: make vet | |
| # An allowlist (ALLOWED in the Makefile), so a plugin can't pull in a | |
| # database driver, a cloud SDK or anything private. Adding a dependency | |
| # means adding it there, in review. | |
| - name: imports are this module, the standard library or approved | |
| if: steps.go.outputs.present == 'true' | |
| run: make imports | |
| # Plugins fetch through env.Get / kit, never on their own. | |
| - name: net/http only in the fetch layer | |
| if: steps.go.outputs.present == 'true' | |
| run: make nethttp | |
| # A provider scaffolded with new-plugin, with a TODO(new-plugin) left. | |
| - name: no TODO(new-plugin) left | |
| if: steps.go.outputs.present == 'true' | |
| run: make todos | |
| # -race: the fetcher and the tests' HTTP servers run on other goroutines. | |
| - name: go test | |
| if: steps.go.outputs.present == 'true' | |
| run: make test |