Skip to content

HPR-1173: Channel Restriction Management #1651

HPR-1173: Channel Restriction Management

HPR-1173: Channel Restriction Management #1651

name: Terraform Provider Checks
on:
pull_request:
paths-ignore:
- 'README.md'
push:
branches:
- main
paths-ignore:
- 'README.md'
jobs:
# ensure go.mod and go.sum are updated
depscheck:
name: Check Dependencies
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
cache: true
go-version-file: 'go.mod'
id: go
- name: Run 'go mod tidy' and check for differences
run: |
make depscheck
# ensure the code builds
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
cache: true
go-version-file: 'go.mod'
id: go
- name: Get dependencies
run: |
go mod download
- name: Build
run: |
go build -v .
# run unit tests and linter
test_and_lint:
name: Unit Test and Lint
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
cache: true
go-version-file: 'go.mod'
id: go
- name: Get dependencies
run: |
go install github.com/golangci/golangci-lint/cmd/[email protected]
go mod download
- name: Run unit tests and linter
run: |
make test-ci
- name: Upload Coverage Artifacts
uses: actions/upload-artifact@v3
with:
name: Test Coverage
path: coverage.html
# ensure docs are generated
gencheck:
name: Check Generated Docs
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
cache: true
go-version-file: 'go.mod'
id: go
- name: Generate docs and check for differences
run: |
make gencheck