feat: Enhanced Test Coverage and Validation for Terratest Using Confluent CLI | DEVOP-5597 #87
This file contains 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: repository-terratest | |
permissions: | |
contents: write | |
pull-requests: write | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
env: | |
TERRATEST_CONFLUENT_CLOUD_SEED_KEY: ${{ secrets.TERRATEST_CONFLUENT_CLOUD_SEED_KEY }} | |
TERRATEST_CONFLUENT_CLOUD_SEED_SECRET: ${{ secrets.TERRATEST_CONFLUENT_CLOUD_SEED_SECRET }} | |
TERRATEST_CONFLUENT_CLOUD_EMAIL: ${{ secrets.TERRATEST_CONFLUENT_CLOUD_EMAIL }} | |
TERRATEST_CONFLUENT_CLOUD_PASSWORD: ${{ secrets.TERRATEST_CONFLUENT_CLOUD_PASSWORD }} | |
TERRATEST_GOOGLE_CREDENTIALS_STORAGE: ${{ secrets.TERRATEST_GOOGLE_CREDENTIALS_STORAGE }} | |
TERRATEST_GOOGLE_PROJECT_STORAGE: ${{ secrets.TERRATEST_GOOGLE_PROJECT_STORAGE }} | |
jobs: | |
repository-terratest: | |
name: repository-terratest | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Set up Go (1.23) | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.23 | |
id: go | |
- name: Install Terraform | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: "1.8.5" | |
- name: Install Confluent CLI | |
run: | | |
# Download and install Confluent CLI | |
curl -sL --http1.1 https://cnfl.io/cli | sh -s -- v3.64.3 -b ./bin | |
# Add ./bin to PATH | |
echo "Adding ./bin to PATH" | |
echo "$PWD/bin" >> $GITHUB_PATH | |
# Explicitly source the updated PATH | |
export PATH=$PATH:$PWD/bin | |
# Verify installation | |
./bin/confluent --version | |
- name: Run terratest | |
run: | | |
cd test | |
go mod tidy | |
go mod download | |
go test -v -timeout 60m | |
- name: Release | |
if: github.event_name == 'push' | |
uses: cycjimmy/semantic-release-action@v4 | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
extra_plugins: | | |
@semantic-release/git@10.0.1 | |
@semantic-release/exec@6.0.2 | |
@semantic-release/changelog@6.0.1 |