Merge pull request #234 from smutel/UpdateDeps #139
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 |