From 6e8965575c6d2f1338484db4c5613477372b6f4b Mon Sep 17 00:00:00 2001 From: Zhuolun Liu Date: Thu, 15 Aug 2024 12:04:52 -0400 Subject: [PATCH] include go test --- .github/workflows/gotest.yml | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gotest.yml b/.github/workflows/gotest.yml index a96b15f..41e8367 100644 --- a/.github/workflows/gotest.yml +++ b/.github/workflows/gotest.yml @@ -20,8 +20,8 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "gotest" - gotest: + # This workflow contains a job for preparing test env, and a job for running go tests + gotest-prep: # The type of runner that the job will run on runs-on: ubuntu-latest @@ -55,4 +55,34 @@ jobs: -AzureDdcVmName ${{vars.AZURE_DDC_VM_NAME}} ` -AzureAdVmName ${{vars.AZURE_AD_VM_NAME}} ` -DisableSSLValidation $true - azPSVersion: "latest" \ No newline at end of file + azPSVersion: "latest" + + gotest: + needs: gotest-prep + + # The type of runner that the job will run on + runs-on: ubuntu-latest + + steps: + # Checkout repo + - name: Checkout Repo + uses: actions/checkout@v4 + with: + ref: test-github-action + # token: ${{secrets.CHECKOUT_TOKEN}} + + # Set up Go + - name: Setup Go 1.21.x + uses: actions/setup-go@v5 + with: + # Semantic version range syntax or exact version of Go + go-version: '1.21.x' + + # Install dependencies + - name: Install dependencies + run: | + go get . + + # Test + - name: Test + run: go test -v ./internal/test -run "^TestProviderPreCheck$" \ No newline at end of file