0.4.2 version bump #328
This file contains hidden or 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: Tests | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| static: | |
| name: Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| concurrency: testing_environment | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Python Setup | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Terraform Setup | |
| uses: hashicorp/setup-terraform@v4 | |
| with: | |
| terraform_version: 1.10.4 | |
| - name: Go Setup | |
| if: github.ref == 'refs/heads/dev' || (github.event_name == 'pull_request' && github.base_ref == 'dev') | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.23' | |
| - name: Build Local Catalyst Center Provider | |
| if: github.ref == 'refs/heads/dev' || (github.event_name == 'pull_request' && github.base_ref == 'dev') | |
| run: | | |
| echo "Setting up local Catalyst Center provider for dev branch/PR..." | |
| # Set up Go environment | |
| export GOPATH=$HOME/go | |
| export PATH=$GOPATH/bin:$PATH | |
| go version | |
| # Clone and build provider from source | |
| git clone https://github.com/CiscoDevNet/terraform-provider-catalystcenter.git /tmp/terraform-provider-catalystcenter | |
| cd /tmp/terraform-provider-catalystcenter | |
| git checkout main | |
| go install | |
| echo "Provider binary installed at: $GOPATH/bin" | |
| ls -la $GOPATH/bin/terraform-provider-catalystcenter || echo "Binary not found" | |
| - name: Configure Terraform Dev Overrides | |
| if: github.ref == 'refs/heads/dev' || (github.event_name == 'pull_request' && github.base_ref == 'dev') | |
| run: | | |
| cat > $HOME/.terraformrc << 'EOF' | |
| provider_installation { | |
| # Use local provider binary built from source | |
| dev_overrides { | |
| "CiscoDevNet/catalystcenter" = "$HOME/go/bin" | |
| } | |
| # For all other providers, install them directly from their origin provider | |
| # registries as normal. If you omit this, Terraform will _only_ use | |
| # the dev_overrides block, and so no other providers will be available. | |
| direct {} | |
| } | |
| EOF | |
| # Expand $HOME in the config file | |
| sed -i "s|\$HOME|$HOME|g" $HOME/.terraformrc | |
| echo "Terraform configuration:" | |
| cat $HOME/.terraformrc | |
| echo "Using local provider build for dev branch" | |
| - name: Tflint Setup | |
| uses: terraform-linters/setup-tflint@v6 | |
| - name: Terraform Docs Setup | |
| run: | | |
| mkdir terraform-docs && cd terraform-docs | |
| curl -sSLo terraform-docs.tar.gz https://terraform-docs.io/dl/v0.18.0/terraform-docs-v0.18.0-linux-amd64.tar.gz | |
| tar -xzf terraform-docs.tar.gz | |
| chmod +x terraform-docs | |
| echo "$GITHUB_WORKSPACE/terraform-docs" >> $GITHUB_PATH | |
| - name: Pre-commit Checks | |
| uses: pre-commit/action@v3.0.1 | |
| - name: Terraform Init | |
| run: terraform init -input=false -no-color | |
| - name: Terraform Validate | |
| run: terraform validate -no-color | |
| - name: Webex Notification | |
| if: always() && github.event_name != 'pull_request' | |
| uses: qsnyder/action-wxt@master | |
| env: | |
| TOKEN: ${{ secrets.WEBEX_TOKEN }} | |
| ROOMID: ${{ secrets.WEBEX_ROOM_ID }} | |
| MESSAGE: | | |
| [**[${{ job.status }}] ${{ github.repository }} #${{ github.run_number }}**](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | |
| * Commit: [${{ github.event.head_commit.message }}](${{ github.event.head_commit.url }})[${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }}) | |
| * Author: ${{ github.event.sender.login }} | |
| * Branch: ${{ github.ref }} ${{ github.head_ref }} | |
| * Event: ${{ github.event_name }} |