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
21 changes: 2 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,20 @@ jobs:
# our oldest (officially) supported version and the two upstream-supported versions
go: [1.21.x, oldstable, stable]

env:
# avoid downloading any alternate toolchains (https://go.dev/doc/toolchain)
GOTOOLCHAIN: local
Comment thread
kolyshkin marked this conversation as resolved.

steps:
- name: checkout source code
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: setup go environment
uses: actions/setup-go@v5
uses: actions/setup-go@v7
with:
go-version: ${{ matrix.go }}

- name: install golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.14
install-only: true

- name: run golangci-lint
run: |
golangci-lint run
cd schema/validate && golangci-lint run --path-prefix schema/validate

- name: run tests
run: |
set -x
make install.tools

make .govet

make .gitvalidation
make docs
make -C schema test
20 changes: 18 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,27 @@ name: Lint
on: [push, pull_request]

jobs:
golangci-lint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
# Keep in sync with the Go version golangci-lint is built with.
go-version: 1.27.x
- name: install golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.14
install-only: true
- name: run golangci-lint
run: make lint

check-format:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Run make -C schema fmt
run: make -C schema fmt
- name: Check for changes
Expand All @@ -16,7 +32,7 @@ jobs:
codespell:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: install deps
run: pip install --break-system-packages codespell==v2.4.1
- name: run codespell
Expand Down
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,10 @@ endif
version.md: ./specs-go/version.go
go run ./.tool/version-doc.go > $@

HOST_GOLANG_VERSION = $(shell go version | cut -d ' ' -f3 | cut -c 3-)
# this variable is used like a function. First arg is the minimum version, Second arg is the version to be checked.
ALLOWED_GO_VERSION = $(shell test '$(shell /bin/echo -e "$(1)\n$(2)" | sort -V | head -n1)' = '$(1)' && echo 'true')

test: .govet .golint .gitvalidation

.govet:
go vet -x ./...
.PHONY: lint
lint:
golangci-lint run
cd schema/validate && golangci-lint run --path-prefix schema/validate

# When this is running in GitHub, it will only check the GitHub commit range
.gitvalidation:
Expand Down
Loading