gitlab.com/greut/eclint@v0.5.2-0.20240402114752-14681fe6e0bf/.gitlab-ci.yml (about) 1 image: golang:1.20-bookworm 2 3 variables: 4 NANCY_VERSION: v1.0 5 GIT_DEPTH: "0" 6 7 stages: 8 - test 9 - lint 10 - check 11 - snapshot 12 13 go test: 14 stage: test 15 script: 16 - go test -v ./... 17 - go test -v ./... 18 -cover -covermode atomic 19 -coverprofile coverage.out 20 -json > test-report.json 21 - go tool cover -func coverage.out 22 - go list -u -m -json all > go-list.json 23 artifacts: 24 paths: 25 - coverage.out 26 - test-report.json 27 - go-list.json 28 29 eclint: 30 stage: lint 31 script: 32 - go build -o eclint gitlab.com/greut/eclint/cmd/eclint 33 - ./eclint -exclude "testdata/**/*" 34 35 golangci-lint: 36 stage: lint 37 image: golangci/golangci-lint 38 script: 39 - golangci-lint run ./... 40 - golangci-lint run -v ./... 41 --issues-exit-code 0 42 --out-format checkstyle > report.xml 43 artifacts: 44 paths: 45 - report.xml 46 47 nancy: 48 stage: check 49 image: sonatypecommunity/nancy:${NANCY_VERSION}-alpine 50 needs: 51 - go test 52 script: 53 - cat go-list.json | nancy --quiet 54 55 sonarcloud check: 56 stage: check 57 allow_failure: true 58 image: 59 name: sonarsource/sonar-scanner-cli:latest 60 entrypoint: [""] 61 needs: 62 - go test 63 - golangci-lint 64 script: 65 - sonar-scanner 66 -Dsonar.projectVersion=$(git describe --abbrev=0 --tags) 67 -Dsonar.qualitygate.wait=true # this does nothing yet 68 69 go-mod-outdated: 70 stage: check 71 allow_failure: true 72 needs: 73 - go test 74 script: 75 - go install github.com/psampaz/go-mod-outdated@latest 76 - cat go-list.json | $GOPATH/bin/go-mod-outdated -update -direct -ci 77 78 goreleaser snapshot: 79 stage: check 80 image: 81 name: goreleaser/goreleaser 82 entrypoint: [''] 83 services: 84 - docker:dind 85 variables: 86 DOCKER_HOST: tcp://docker:2375 87 GIT_DEPTH: 0 88 script: 89 - goreleaser --snapshot --skip-sign