chore: last chance for GHA. I'm about to pull the dagger here
Some checks failed
Integration / metadata (push) Has been cancelled
Integration / lint (push) Has been cancelled
Integration / test (push) Has been cancelled
Security / metadata (push) Has been cancelled
Security / analyze (push) Has been cancelled
Integration / build (push) Has been cancelled
Integration / report (push) Has been cancelled
Integration / container (push) Has been cancelled
Security / security-scan (push) Has been cancelled

Signed-off-by: William Artero <git@artero.dev>
This commit is contained in:
William Artero 2023-12-06 16:17:03 +01:00
parent 6cecec1a1c
commit 6c5e904e9d
Signed by: wwmoraes
GPG key ID: 4180618C988F24A3
9 changed files with 61 additions and 16 deletions

View file

@ -147,15 +147,19 @@ jobs:
runs-on: ubuntu-latest
env:
CONTAINER_LINT_REPORT_FILE: hadolint-report.json
GOLANGCI_LINT_REPORT_FILE: golangci-lint-report.json
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup golang
uses: actions/setup-go@v3
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: set golang environment variables
uses: wwmoraes/actions/golang/env@master
- name: cache modules
uses: pat-s/always-upload-cache@v2.1.5
with:
@ -164,8 +168,10 @@ jobs:
restore-keys: |
${{ runner.os }}-modules-${{ hashFiles('go.sum') }}
${{ runner.os }}-modules-
- name: download modules
run: go mod download
- name: cache lint
uses: pat-s/always-upload-cache@v2.1.5
with:
@ -174,12 +180,21 @@ jobs:
restore-keys: |
${{ runner.os }}-lint-${{ hashFiles('.golangci.yaml') }}
${{ runner.os }}-lint-
- name: lint code source
uses: wwmoraes/actions/golang/lint@master
id: lint
- name: lint code
run: make lint-report
env:
CONTAINER_LINT_FORMAT: sarif
GOLANGCI_LINT_FORMAT: github-actions
- name: setup reviewdog
uses: reviewdog/action-setup@v1
with:
work-dir: ${{ env.WORK_DIR }}
version: v1.46-alpine
reviewdog_version: latest
- name: review code
run: make review-report
- name: upload code lint report
uses: actions/upload-artifact@v3
if: always()
@ -304,6 +319,13 @@ jobs:
name: coverage-report
path: ${{ env.GOLANG_COVERAGE_PATH }}
- name: touch downloaded reports
run: |-
ls
ls coverage
touch -c coverage/run-report.json
touch -c coverage/merged.txt
# - name: SonarCloud Scan
# uses: sonarsource/sonarcloud-github-action@master
# env:

View file

@ -1,3 +1,4 @@
# cspell:disable
run:
modules-download-mode: readonly
issues-exit-code: 0

View file

@ -6,4 +6,4 @@ CODECOV_TOKEN ?=
codecov-report:
$(if $<,,$(error target codecov-report must have a source file as dependency))
$(info uploading Codecov report)
@${CODECOV} create-report -c -t ${CODECOV_TOKEN} ${CODECOV_FLAGS} -f "$<"
@${CODECOV} create-report -c -t ${CODECOV_TOKEN} ${CODECOV_FLAGS} $(addprefix -f ,$^)

View file

@ -1,8 +1,12 @@
CONTAINER ?= docker
CONTAINER_LINT ?= hadolint
CONTAINER_STRUCTURE_TEST ?= container-structure-test
CONTAINER_IMAGE ?=
CONTAINER_STRUCTURE_TEST_FILE ?=
CONTAINER_LINT_REPORT_FILE ?= hadolint-report.json
CONTAINER_DOCKERFILE ?= Dockerfile
CONTAINER_LINT_FORMAT ?= sarif
## https://github.com/moby/moby/issues/46129
container-image: OTEL_EXPORTER_OTLP_ENDPOINT=
@ -21,3 +25,13 @@ container-image:
container-test: ${CONTAINER_STRUCTURE_TEST_FILE}
@${CONTAINER_STRUCTURE_TEST} test -c "$<" -i "${CONTAINER_IMAGE}"
container-lint: ${CONTAINER_DOCKERFILE}
$(info linting container source $<)
@${CONTAINER_LINT} $<
container-lint-report: ${CONTAINER_LINT_REPORT_FILE}
${CONTAINER_LINT_REPORT_FILE}: ${CONTAINER_DOCKERFILE}
$(info generating lint report of container source $<)
@${CONTAINER_LINT} -f ${CONTAINER_LINT_FORMAT} $< > $@

View file

@ -1,12 +1,17 @@
GO ?= go
GOLANGCI_LINT ?= golangci-lint
GOLANGCI_LINT_REPORT_FILE ?= golangci-lint-report.xml
GOLANGCI_LINT_REPORT_FILE ?= golangci-lint-report.json
GOLANGCI_LINT_FORMAT ?= json
GOLANGCI_LINT_SOURCE_FILES ?= $(shell ${GO} list -f '{{ range .GoFiles }}{{ printf "%s/%s\n" $$.Dir . }}{{ end }}' ./...)
.PHONY: golang-lint
golang-lint: ${GOLANGCI_LINT_REPORT_FILE}
golang-lint:
$(info linting go source)
@${GOLANGCI_LINT} run
golang-lint-report: ${GOLANGCI_LINT_REPORT_FILE}
${GOLANGCI_LINT_REPORT_FILE}: ${GOLANGCI_LINT_SOURCE_FILES}
@${GOLANGCI_LINT} run --out-format checkstyle > $@
$(info generating lint report of go source)
@${GOLANGCI_LINT} run --out-format json > $@

View file

@ -1,3 +1,4 @@
# cspell:disable
## See https://pre-commit.com for more information
## See https://pre-commit.com/hooks.html for more hooks
repos:

View file

@ -33,7 +33,10 @@ release: golang-release
test: golang-test
.PHONY: lint
lint: golang-lint
lint: golang-lint container-lint
.PHONY: lint-report
lint-report: golang-lint-report container-lint-report
.PHONY: coverage
coverage: golang-coverage

View file

@ -1,14 +1,12 @@
# cspell:disable
schemaVersion: "2.0.0"
fileExistenceTests:
- name: handler binary
path: /usr/local/bin/handler
shouldExist: true
## Docker and Podman differ on how they handle the ownership of binaries.
## Docker retains the source UID and GID; Podman ignores it, and reports the
## active UID:GID as per the last USER directive
## TODO fix binary owership
# gid: 0
# uid: 0
gid: 0
uid: 0
permissions: -rwxr-xr-x
isExecutableBy: any

View file

@ -42,6 +42,7 @@ words:
- promhttp
- promql
- pyroscope
- radarr
- redisotel
- riandyrn
- romaji