-
Notifications
You must be signed in to change notification settings - Fork 6
37 lines (35 loc) · 1.04 KB
/
pr.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
name: Pull Request
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Go 1.21.x
uses: actions/setup-go@v4
with:
go-version-file: ${{ github.workspace }}/src/go.mod
cache: true
cache-dependency-path: ${{ github.workspace }}/src/go.sum
- name: Install dependencies
working-directory: ${{ github.workspace }}/src
run: |
go get .
- name: Download modules
working-directory: ${{ github.workspace }}/src
run: |
go mod download
- name: Build
working-directory: ${{ github.workspace }}/src
run: go build -v ./...
- name: Run linters
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
with:
working-directory: ${{ github.workspace }}/src
version: latest
- name: Run tests
working-directory: ${{ github.workspace }}/src
run: go test -v ./...