From dac812dc6e8dd596ef8dafa73ce35474c2621554 Mon Sep 17 00:00:00 2001 From: samitab Date: Wed, 24 Apr 2024 12:14:13 +1000 Subject: [PATCH] [ignore] Added Terraform CI for build and integration tests --- .github/workflows/checks.yml | 62 ++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/checks.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 000000000..abfba7ec2 --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,62 @@ +name: CI + +on: + push: + branches: [master] + 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 + # - name: Generate provider code + # run: go generate + # - name: Check generated code for diffs + # run: git diff --exit-code + - name: Build + run: go build -v + acceptance: + name: Acceptance Tests + needs: build + runs-on: ubuntu-latest + concurrency: + group: tf-aci-ci-test-${{ matrix.apic_host.name }} + cancel-in-progress: false + strategy: + fail-fast: false + matrix: + apic_host: + - name: v5.2 + url: 'https://173.36.219.83/' + - name: v6.0 + url: 'https://173.36.219.84/' + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - uses: hashicorp/setup-terraform@v2 + with: + terraform_version: '1.7.*' + terraform_wrapper: false + - name: Terraform Acceptance Test (APIC ${{ matrix.apic_host.name }}) + run: go test github.com/CiscoDevNet/terraform-provider-aci/v2/internal/provider -v -cover -timeout 120m + env: + TF_ACC: '1' + TF_ACC_STATE_LINEAGE: '1' + ACI_VAL_REL_DN: false + ACI_USERNAME: ${{ secrets.TF_ACC_ACI_USERNAME }} + ACI_PASSWORD: ${{ secrets.TF_ACC_ACI_PASSWORD }} + ACI_URL: ${{ matrix.apic_host.url }} \ No newline at end of file