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/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Lint | |
uses: reviewdog/[email protected] | |
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/[email protected] | |
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/[email protected] | |
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 |