Skip to content

Add ND version and site resources (DCNE-179) #8

Add ND version and site resources (DCNE-179)

Add ND version and site resources (DCNE-179) #8

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
permissions:
# Permission for checking out code
contents: read
jobs:
build:
name: Check & Build Provider
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- run: chmod +x ./scripts/gofmtcheck.sh
- name: gofmt Check
run: ./scripts/gofmtcheck.sh
- run: go mod tidy
- run: go mod vendor
- name: Check vendor for changes
run: git diff --exit-code
- name: Build
run: go build -v
go-releaser:
name: Dry-Run GoReleaser Check
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Unshallow
run: git fetch --prune --unshallow
- uses: actions/setup-go@v5
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
install-only: true
version: latest
- name: GoReleaser Release Check
run: goreleaser release --skip=publish,sign --snapshot --clean
acceptance:
name: Acceptance Tests
if: github.repository_owner == 'CiscoDevNet'
needs: [build]
runs-on: ubuntu-latest
env:
ND_USERNAME: "ansible_github_ci"
ND_PASSWORD: "sJ94G92#8dq2hx*K4qh"
concurrency:
group: tf-nd-ci-test-${{ matrix.nd_host.name }}
cancel-in-progress: false
strategy:
fail-fast: false
matrix:
nd_host:
- name: v3.1
url: "https://173.36.219.35/"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.7.*"
terraform_wrapper: false
- name: Terraform Acceptance Test (ND ${{ matrix.nd_host.name }})
run: go test github.com/CiscoDevNet/terraform-provider-nd/internal/provider -v -race -timeout 300m -coverprofile=coverage.out -covermode=atomic
env:
TF_ACC: "1"
TF_ACC_STATE_LINEAGE: "1"
ND_VAL_REL_DN: false
ND_URL: ${{ matrix.nd_host.url }}
- name: Upload coverage to Codecov
# Upload Coverage on latest only
if: ${{ matrix.nd_host.name == 'v3.1'}}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}