-
Notifications
You must be signed in to change notification settings - Fork 19
65 lines (56 loc) · 1.73 KB
/
master.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
name: Master
on:
push:
branches:
- master
jobs:
LintAndBuild:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ['1.22.x']
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
with:
fetch-depth: 0
- name: Lint
uses: reviewdog/action-golangci-lint@v2.3.3
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--config=.golangci.yml"
- name: Setup env
run: |
echo "GOPATH=$(dirname $GITHUB_WORKSPACE)" >> $GITHUB_ENV
echo "$(dirname $GITHUB_WORKSPACE)/bin" >> $GITHUB_PATH
mkdir -p "$(dirname $GITHUB_WORKSPACE)/src/github.com/smutel"
ln -sf "$GITHUB_WORKSPACE/" "$(dirname $GITHUB_WORKSPACE)/src/github.com/smutel/terraform-provider-netbox"
shell: bash
- name: Go installation
uses: actions/setup-go@v4.0.1
with:
go-version: ${{ matrix.go }}
- name: Go fmt
run: |
cd "$(dirname $GITHUB_WORKSPACE)/src/github.com/smutel/terraform-provider-netbox"
find . -name "*.go" -exec gofmt -s -w {} \;
shell: bash
- name: Go generate
run: |
cd "$(dirname $GITHUB_WORKSPACE)/src/github.com/smutel/terraform-provider-netbox"
go generate
shell: bash
- name: Commit changes
uses: EndBug/add-and-commit@v9.1.3
with:
add: 'netbox docs'
author_name: smutel
default_author: github_actor
message: 'ci: Go fmt & go generate'
- name: Build
run: |
cd "$(dirname $GITHUB_WORKSPACE)/src/github.com/smutel/terraform-provider-netbox"
make build
shell: bash