2023-09-15 17:30:17 +00:00
|
|
|
name: CI
|
|
|
|
|
2020-11-25 19:52:37 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2023-09-15 17:30:17 +00:00
|
|
|
- main
|
|
|
|
- master
|
|
|
|
tags:
|
|
|
|
- v*
|
|
|
|
|
2020-11-25 19:52:37 +00:00
|
|
|
pull_request:
|
2023-09-15 17:30:17 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-11-25 19:52:37 +00:00
|
|
|
jobs:
|
2023-09-15 17:30:17 +00:00
|
|
|
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Check out code
|
2024-06-18 02:00:36 +00:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2023-09-15 17:30:17 +00:00
|
|
|
-
|
|
|
|
name: Set up Go
|
2024-07-15 16:50:37 +00:00
|
|
|
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
2023-09-15 17:30:17 +00:00
|
|
|
with:
|
|
|
|
go-version-file: 'go.mod'
|
|
|
|
id: go
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
run: go build -v .
|
|
|
|
-
|
|
|
|
name: Test
|
|
|
|
run: go test -v ./...
|
|
|
|
|
|
|
|
lint:
|
|
|
|
name: Lint
|
2020-11-25 19:52:37 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-15 17:30:17 +00:00
|
|
|
-
|
|
|
|
name: Checkout code
|
2024-06-18 02:00:36 +00:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2023-09-15 17:30:17 +00:00
|
|
|
-
|
|
|
|
name: Set up Go
|
2024-07-15 16:50:37 +00:00
|
|
|
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
2022-06-28 20:42:12 +00:00
|
|
|
with:
|
2023-09-14 23:11:03 +00:00
|
|
|
go-version-file: 'go.mod'
|
2023-09-15 17:30:17 +00:00
|
|
|
-
|
|
|
|
name: golangci-lint
|
2024-05-21 04:26:36 +00:00
|
|
|
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1
|
2020-11-25 19:52:37 +00:00
|
|
|
with:
|
|
|
|
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
2023-09-15 00:10:36 +00:00
|
|
|
version: v1.54.2
|
2022-06-28 20:42:12 +00:00
|
|
|
args: --timeout=5m --modules-download-mode=mod
|
2023-09-14 23:11:03 +00:00
|
|
|
skip-pkg-cache: true
|