Merge pull request #260 from dagger/golangci-gh-action
ci: use golangci github action
This commit is contained in:
commit
6820b99637
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
@ -27,12 +27,20 @@ jobs:
|
|||||||
echo "Installing cue version $CUE_VERSION"
|
echo "Installing cue version $CUE_VERSION"
|
||||||
curl -L https://github.com/cuelang/cue/releases/download/${CUE_VERSION}/${CUE_TARBALL} | sudo tar zxf - -C /usr/local/bin
|
curl -L https://github.com/cuelang/cue/releases/download/${CUE_VERSION}/${CUE_TARBALL} | sudo tar zxf - -C /usr/local/bin
|
||||||
|
|
||||||
# golangci
|
- name: Go Lint
|
||||||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sudo sh -s -- -b /usr/local/bin v1.23.8
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
with:
|
||||||
|
version: v1.39
|
||||||
|
skip-go-installation: true
|
||||||
|
args: --timeout=3m
|
||||||
|
|
||||||
|
- name: Cue Lint
|
||||||
|
run: |
|
||||||
|
make cuelint
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: |
|
run: |
|
||||||
make lint
|
make check-buildkit-version
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
|
@ -26,7 +26,7 @@ linters:
|
|||||||
- nakedret
|
- nakedret
|
||||||
- prealloc
|
- prealloc
|
||||||
- rowserrcheck
|
- rowserrcheck
|
||||||
- scopelint
|
- exportloopref
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- structcheck
|
- structcheck
|
||||||
- stylecheck
|
- stylecheck
|
||||||
|
12
Makefile
12
Makefile
@ -13,17 +13,23 @@ dagger-debug:
|
|||||||
test:
|
test:
|
||||||
go test -race -v ./...
|
go test -race -v ./...
|
||||||
|
|
||||||
|
.PHONY: golint
|
||||||
|
golint:
|
||||||
|
golangci-lint run --timeout 3m
|
||||||
|
|
||||||
.PHONY: cuefmt
|
.PHONY: cuefmt
|
||||||
cuefmt:
|
cuefmt:
|
||||||
@(cue fmt -s ./stdlib/...)
|
@(cue fmt -s ./stdlib/...)
|
||||||
@(cue fmt -s ./examples/*/)
|
@(cue fmt -s ./examples/*/)
|
||||||
@(cue fmt -s ./tests/...)
|
@(cue fmt -s ./tests/...)
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: cuelint
|
||||||
lint: cuefmt check-buildkit-version
|
cuelint: cuefmt
|
||||||
golangci-lint run --timeout 3m
|
|
||||||
@test -z "$$(git status -s . | grep -e "^ M" | grep .cue | cut -d ' ' -f3 | tee /dev/stderr)"
|
@test -z "$$(git status -s . | grep -e "^ M" | grep .cue | cut -d ' ' -f3 | tee /dev/stderr)"
|
||||||
|
|
||||||
|
.PHONY: lint
|
||||||
|
lint: cuelint golint check-buildkit-version
|
||||||
|
|
||||||
.PHONY: check-buildkit-version
|
.PHONY: check-buildkit-version
|
||||||
check-buildkit-version:
|
check-buildkit-version:
|
||||||
@test \
|
@test \
|
||||||
|
@ -103,7 +103,7 @@ func (s *Store) syncDeployment(r *DeploymentState) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := os.WriteFile(p, data, 0644); err != nil {
|
if err := os.WriteFile(p, data, 0600); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user