From d378c121073f737c46bae82b8c9484ff2cc442c8 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 28 Aug 2021 02:32:24 +0900 Subject: [PATCH] .github/workflow: Add an atomic align check Closes #1661 --- .github/workflows/test.yml | 5 +++++ .github/workflows/vettools/atomicalign.go | 27 +++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/vettools/atomicalign.go diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c3cd3c75a..a9c961b74 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -67,6 +67,11 @@ jobs: run: | go vet -tags=example -v ./... + - name: go vet (atomic align) + run: | + go install .github/workflows/vettools/atomicalign.go + go vet -vettool=$(which atomicalign) -tags=example -v ./... + - name: go build run: | go build -tags=example -v ./... diff --git a/.github/workflows/vettools/atomicalign.go b/.github/workflows/vettools/atomicalign.go new file mode 100644 index 000000000..66fc91297 --- /dev/null +++ b/.github/workflows/vettools/atomicalign.go @@ -0,0 +1,27 @@ +// Copyright 2021 The Ebiten Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build ignore +// +build ignore + +package main + +import ( + "golang.org/x/tools/go/analysis/multichecker" + "golang.org/x/tools/go/analysis/passes/atomicalign" +) + +func main() { + multichecker.Main(atomicalign.Analyzer) +}