Skip to content

Commit c53652d

Browse files
authored
Golang CI (#29)
* add language server Signed-off-by: Chip Zoller <[email protected]> * init basic Golang CI Signed-off-by: Chip Zoller <[email protected]> * install govulncheck directly Signed-off-by: Chip Zoller <[email protected]> --------- Signed-off-by: Chip Zoller <[email protected]>
1 parent 56989d3 commit c53652d

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

.github/workflows/ci-checks.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
name: CI checks
3+
permissions: {}
4+
on:
5+
workflow_dispatch: {}
6+
push:
7+
branches:
8+
- '*'
9+
pull_request:
10+
branches:
11+
- main
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
18+
19+
- name: Setup Golang
20+
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
21+
with:
22+
go-version: 1.22
23+
24+
- name: golangci-lint
25+
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1
26+
with:
27+
version: v1.58
28+
29+
- name: Go Format
30+
run: gofmt -s -w . && git diff --exit-code
31+
32+
- name: Go Vet
33+
run: go vet ./...
34+
35+
- name: Go Tidy
36+
run: go mod tidy && git diff --exit-code
37+
38+
- name: Go Mod
39+
run: go mod download
40+
41+
- name: Go Mod Verify
42+
run: go mod verify
43+
44+
- name: Go Generate
45+
run: go generate ./... && git diff --exit-code
46+
47+
- name: Go Build
48+
run: go build -o /dev/null ./...
49+
50+
- name: Go Test
51+
run: go test -v -count=1 -race -shuffle=on -coverprofile=coverage.txt ./...
52+
53+
- name: Install govulncheck
54+
run: go install golang.org/x/vuln/cmd/govulncheck@latest
55+
56+
- name: Run govulncheck
57+
run: govulncheck -test ./...
58+
59+
- name: Upload coverage report
60+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
61+
with:
62+
name: coverage.txt
63+
path: coverage.txt
64+
if-no-files-found: error

.github/workflows/release.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
13
### This workflow uses the SLSA container provenance generator workflow
24
### (see https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md)
35
### to generate a SLSA provenance type predicate for a container image built by ko and attesting to it and others

0 commit comments

Comments
 (0)