File tree Expand file tree Collapse file tree 14 files changed +117
-41
lines changed
docs/continuous-integration Expand file tree Collapse file tree 14 files changed +117
-41
lines changed Original file line number Diff line number Diff line change 55 schedule :
66 interval : weekly
77 open-pull-requests-limit : 5
8+ - package-ecosystem : " docker"
9+ directory : " /"
10+ schedule :
11+ interval : " weekly"
Original file line number Diff line number Diff line change 1- name : Gitleaks
2-
3- on : [pull_request, push, workflow_dispatch]
4-
1+ name : gitleaks
2+ on : [push]
53jobs :
64 gitleaks :
7- name : Secret Scan
85 runs-on : ubuntu-latest
96 steps :
10- - name : Check out the repo
7+ - name : Checkout
118 uses : actions/checkout@v2
129 - name : Run gitleaks
1310 run : docker run -v ${{ github.workspace }}:/path zricethezav/gitleaks:latest detect -v --source="/path" --redact
14-
1511 run-if-failed :
16- name : Github Security Report (if gitleaks job fails)
12+ name : gen-report (if gitleaks fails)
1713 runs-on : ubuntu-latest
1814 needs : [gitleaks]
1915 if : always() && (needs.gitleaks.result == 'failure')
2016 permissions :
2117 security-events : write
2218 steps :
23- - name : Check out the repo
19+ - name : Checkout
2420 uses : actions/checkout@v2
2521 - name : Generate gitleaks SARIF file
2622 # Exit 0 so we can get the failed report results from this step.
Original file line number Diff line number Diff line change 11name : golangci-lint
2- on :
3- push :
4- pull_request :
2+ on : [push]
53permissions :
64 contents : read
75 # Optional: allow read access to pull request. Use with `only-new-issues` option.
86 # pull-requests: read
97jobs :
10- golangci :
11- name : lint
8+ lint :
129 runs-on : ubuntu-latest
1310 steps :
1411 - uses : actions/setup-go@v3
1512 with :
1613 go-version : 1.17
17- - uses : actions/checkout@v3
18- - name : golangci-lint
14+ - name : Checkout
15+ uses : actions/checkout@v3
16+ - name : Run linters
1917 uses : golangci/golangci-lint-action@v3
2018 with :
2119 # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
Original file line number Diff line number Diff line change 1- name : gen-docs
1+ name : mkdocs
22on :
33 push :
44 branches :
5- - master
65 - main
76jobs :
87 deploy :
98 runs-on : ubuntu-latest
109 steps :
11- - uses : actions/checkout@v2
12- - uses : actions/setup-python@v2
10+ - name : Checkout
11+ uses : actions/checkout@v2
12+ - name : Setup Python
13+ uses : actions/setup-python@v2
1314 with :
1415 python-version : 3.x
15- - run : pip install mkdocs-material
16- - run : mkdocs gh-deploy --force
16+ - name : Install mkdocs-material
17+ run : pip install mkdocs-material
18+ - name : Publish to gh-pages
19+ run : mkdocs gh-deploy --force
Original file line number Diff line number Diff line change 11name : release
2-
32on :
43 push :
54 branches :
65 - main
76jobs :
8- tag :
7+ semantic-release :
98 runs-on : ubuntu-latest
109 strategy :
1110 matrix :
1211 node-version :
1312 - 16.x
1413 steps :
15- - name : Checkout
14+ -
15+ name : Checkout
1616 uses : actions/checkout@v3
1717 with :
1818 fetch-depth : 0
19- - name : Release
19+ -
20+ name : Release
2021 env :
2122 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2223 run : npx semantic-release
2324 goreleaser :
2425 runs-on : ubuntu-latest
25- needs : tag
26+ needs : semantic-release
2627 steps :
2728 -
2829 name : Checkout
Original file line number Diff line number Diff line change 1+ name : tests
2+ on : [push]
3+ jobs :
4+ test :
5+ runs-on : ubuntu-latest
6+ steps :
7+ - name : Checkout
8+ uses : actions/checkout@v2
9+ - name : Setup Go
10+ uses : actions/setup-go@v2
11+ with :
12+ go-version : 1.18
13+ - name : Go Test
14+ run : go test -v ./...
Original file line number Diff line number Diff line change 44* .dll
55* .so
66* .dylib
7+ bin /
78
89# Test binary, built with `go test -c`
910* .test
1415# Dependency directories (remove the comment below to include it)
1516# vendor/
1617
17- bin /
18+ # Code editor personal settings
19+ .vscode /
20+ .idea /
21+
22+ # Other
23+ .DS_Store
Original file line number Diff line number Diff line change 99 - id : check-yaml
1010 - id : check-added-large-files
1111 - repo : https://github.com/golangci/golangci-lint
12- rev : v1.47.0
12+ rev : v1.47.2
1313 hooks :
1414 - id : golangci-lint
1515 - repo : https://github.com/zricethezav/gitleaks
Original file line number Diff line number Diff line change 1- FROM golang:1.18 as build
2- WORKDIR /go/src/app
1+ FROM golang:1.18-alpine as builder
2+
3+ RUN apk update && apk upgrade && \
4+ apk add --no-cache make bash
5+
6+ WORKDIR /src
37COPY . .
4- # Static build requires CGO_ENABLED=0
5- RUN mkdir -p /go/bin && CGO_ENABLED=0 go build -ldflags="-w -s" -o /go/bin/app ./...
8+
9+ # Build executable
10+ RUN make build
611
712# Using a distroless image from https://github.com/GoogleContainerTools/distroless
8- # Image sourced from https://console.cloud.google.com/gcr/images/distroless/global/static
913FROM gcr.io/distroless/static:nonroot
10- COPY --from=build /go/bin/app /
11- # numeric version of user nonroot:nonroot provided in image
14+
15+ # Copy executable from builder image
16+ COPY --from=builder /src/bin/app /
17+
18+ # Numeric version of user nonroot:nonroot provided in image
1219USER 65532:65532
20+
21+ # Run the executable
1322CMD ["/app" ]
Original file line number Diff line number Diff line change 11SHELL =/bin/bash -e -o pipefail
22PWD = $(shell pwd)
3+ GO_BUILD = go build
4+ GOFLAGS = CGO_ENABLED=0
35
46# # help: Print this help message
57.PHONY : help
3739# # build: Build binary into bin/ directory
3840.PHONY : build
3941build :
40- go build - ldflags=" -w -s" -o bin/app ./...
42+ $( GOFLAGS ) $( GO_BUILD ) -a -v - ldflags=" -w -s" -o bin/app cmd/main.go
You can’t perform that action at this time.
0 commit comments