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-05-21 04:26:17 +00:00
|
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
2023-09-15 17:30:17 +00:00
|
|
|
-
|
|
|
|
name: Set up Go
|
2024-05-07 19:08:49 +00:00
|
|
|
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
|
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-05-21 04:26:17 +00:00
|
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
2023-09-15 17:30:17 +00:00
|
|
|
-
|
|
|
|
name: Set up Go
|
2024-05-07 19:08:49 +00:00
|
|
|
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
|
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
|