trying to get ci to use the local provider #86
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: GoTests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test-go: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: 1.22.8 | |
| - name: Install Coder Terraform Provider Locally | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| repository: 'coder/terraform-provider-coder' | |
| ref: 'stevenmasley/form_control' | |
| path: "terraform-provider-coder" | |
| - name: Build Local Terraform Provider | |
| run: | | |
| cd terraform-provider-coder | |
| go build -o terraform-provider-coder | |
| cd .. | |
| - name: Setup dev terraform | |
| run: | | |
| touch $HOME/.terraformrc | |
| echo provider_installation { > $HOME/.terraformrc | |
| echo dev_overrides { >> $HOME/.terraformrc | |
| echo "coder/coder" = "$GITHUB_WORKSPACE/terraform-provider-coder" >> $HOME/.terraformrc | |
| echo } >> $HOME/.terraformrc | |
| echo direct {} >> $HOME/.terraformrc | |
| echo } >> $HOME/.terraformrc | |
| echo "'.terraformrc' contents" | |
| cat $HOME/.terraformrc | |
| - uses: actions/checkout@v4.2.2 | |
| - name: Install gotestsum | |
| shell: bash | |
| run: go install gotest.tools/gotestsum@latest | |
| - name: Run tests | |
| run: TF_CLI_CONFIG_FILE=$HOME/.terraformrc gotestsum ./... |