Skip to content
This repository was archived by the owner on Mar 22, 2022. It is now read-only.

Commit 1a1f0c1

Browse files
committed
Containerize lint
Signed-off-by: Christopher Crone <[email protected]>
1 parent ce0b659 commit 1a1f0c1

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: actions/checkout@v2
1616

1717
- name: Lint
18-
run: make lint
18+
run: DOCKER_BUILDKIT=1 make lint
1919

2020
- name: Build
2121
run: make build

Makefile

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.DEFAULT_GOAL := help
22

33
PACKAGE=github.com/compose-spec/compose-ref
4+
IMAGE_PREFIX=composespec/compose-ref-
45

56
GOFLAGS=-mod=vendor
67

@@ -16,9 +17,13 @@ test: ## Run tests
1617
fmt: ## Format go files
1718
@goimports -e -w ./
1819

20+
.PHONY: build-validate-image
21+
build-validate-image:
22+
docker build . -f ci/Dockerfile -t $(IMAGE_PREFIX)validate
23+
1924
.PHONY: lint
20-
lint: ## Verify Go files
21-
golangci-lint run --config ./golangci.yml ./
25+
lint: build-validate-image
26+
docker run --rm $(IMAGE_PREFIX)validate bash -c "golangci-lint run --config ./golangci.yml ./"
2227

2328
.PHONY: setup
2429
setup: ## Setup the precommit hook

ci/Dockerfile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM golang:1.14
2+
3+
WORKDIR /go/src
4+
5+
ARG GOLANGCILINT_VERSION=v1.24.0
6+
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCILINT_VERSION}
7+
8+
ENV GOFLAGS=-mod=vendor
9+
COPY . .

0 commit comments

Comments
 (0)