-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (48 loc) · 1.48 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: CI
on:
pull_request:
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Run actions/checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Run actions/setup-go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
with:
go-version-file: "go.mod"
cache: true
- name: Download go modules
run: go mod download
- name: Compile go packages
run: go build -o example_echo cmd/main.go
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Run actions/checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Run reviewdog/action-golangci-lint
uses: reviewdog/action-golangci-lint@dd3fda91790ca90e75049e5c767509dc0ec7d99b # v2
with:
github_token: ${{ github.token }}
go_version_file: "go.mod"
golangci_lint_flags: "--config=config/.golangci.yml"
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Run actions/checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Run actions/setup-go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
with:
go-version-file: "go.mod"
cache: true
- name: Run tests
run: go test ./...