Add prompt-on-launch support for workflow jobs #516
Workflow file for this run
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: Provider Unit Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| build-and-test: | |
| name: | |
| runs-on: ubuntu-latest | |
| env: | |
| go_version: '1.24' | |
| steps: | |
| - name: Checkout Provider | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go ${{ env.go_version }} | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.go_version }} | |
| - name: Install Go dependencies | |
| run: go get . | |
| - name: Build the Provider | |
| run: go build -v ./... | |
| - name: Run Provider Unit Tests | |
| run: make testcov | |
| - name: SonarCube Static Scans (on push) | |
| uses: SonarSource/sonarqube-scan-action@v5 | |
| if: github.event_name == 'push' && startsWith(github.repository, 'ansible') && endsWith(github.repository, '/terraform-provider-aap') | |
| env: | |
| SONAR_TOKEN: ${{ secrets[format('{0}', vars.SONAR_TOKEN_SECRET_NAME)] }} | |
| with: | |
| args: > | |
| -Dsonar.go.coverage.reportPaths=unit-testing.cov | |
| - name: Upload code coverage report from unit tests | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: unit-testing.cov | |
| - name: Save off PR Number | |
| run: echo "PR ${{ github.event.number }}" > pr_number.txt | |
| - name: Upload PR Number | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pr_number | |
| path: pr_number.txt |