[chore][Ansible] Minimal changes for certification (#7271) #17616
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: build-and-test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: # Allows manual execution of the workflow | |
| concurrency: | |
| group: build-and-test-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| GO_VERSION: 1.25.7 | |
| jobs: | |
| tidy: | |
| name: tidy | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/setup-environment | |
| - name: tidy | |
| run: | | |
| make tidy-all | |
| if ! git diff --exit-code; then | |
| echo "One or more Go files are not tidied. Run 'make tidy-all' and push the changes." | |
| exit 1 | |
| fi | |
| gofmt: | |
| name: gofmt | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/setup-environment | |
| - name: gofmt | |
| run: | | |
| make fmt-all | |
| if ! git diff --exit-code; then | |
| echo "One or more Go files are not formatted correctly. Run 'make fmt-all' and push the changes." | |
| exit 1 | |
| fi | |
| generate-metrics: | |
| name: generate-metrics | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/setup-environment | |
| - name: generate-metrics | |
| run: | | |
| make generate-metrics | |
| if ! git diff --exit-code; then | |
| echo "Generated code is out of date. Run 'make generate-metrics' and push the changes." | |
| exit 1 | |
| fi | |
| lint: | |
| name: lint | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/setup-environment | |
| - run: echo "GOLANGCI_LINT_CACHE=${HOME}/.cache/golangci-lint" >> "$GITHUB_ENV" | |
| - uses: actions/cache@v5 | |
| with: | |
| path: ${{ env.GOLANGCI_LINT_CACHE }} | |
| key: golangci-lint-${{ hashFiles('**/.golangci.yml', '**/*.go', '**/go.sum') }} | |
| - name: Lint | |
| run: | | |
| make lint-all | |
| actionlint: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Download actionlint | |
| id: get_actionlint | |
| run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/0933c14/scripts/download-actionlint.bash) # v1.7.10 | |
| shell: bash | |
| - name: Check workflow files | |
| run: ${{ steps.get_actionlint.outputs.executable }} -color | |
| shell: bash | |
| test: | |
| name: test-${{ matrix.OS }}-race_detection:${{ matrix.TEST_RACE }}-coverage:${{ !matrix.TEST_RACE }} | |
| strategy: | |
| matrix: | |
| OS: [ "ubuntu-24.04", "macos-14", "macos-15", "windows-2025", "windows-11-arm" ] | |
| TEST_RACE: [ true, false ] | |
| exclude: | |
| - OS: "windows-11-arm" | |
| TEST_RACE: true | |
| uses: ./.github/workflows/reusable-unit-test.yml | |
| with: | |
| OS: ${{ matrix.OS }} | |
| COVERAGE: ${{ !matrix.TEST_RACE }} # No coverage when running with race | |
| TEST_RACE: ${{ matrix.TEST_RACE }} | |
| secrets: inherit | |
| coverage: | |
| name: coverage | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Free up disk space for next step | |
| uses: jlumbroso/free-disk-space@v1.3.1 | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/setup-environment | |
| - name: Run Unit Tests With Coverage | |
| run: COVER_TESTING=true make gotest-with-codecov | |
| - name: Upload coverage report | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # 5.5.2 | |
| with: | |
| fail_ci_if_error: true | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| cross-compile: | |
| strategy: | |
| matrix: | |
| SYS_BINARIES: [ "binaries-darwin_amd64", "binaries-darwin_arm64", "binaries-linux_amd64", "binaries-linux_arm64", "binaries-windows_amd64", "binaries-windows_arm64", "binaries-linux_ppc64le" ] | |
| uses: ./.github/workflows/reusable-compile.yml | |
| with: | |
| SYS_BINARY: ${{ matrix.SYS_BINARIES }} | |
| latest-dockerd-test: | |
| # Run this as a separate test to avoid affecting other tests with the dockerd upgrade. | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/setup-environment | |
| - name: dockerd test | |
| working-directory: ./internal/signalfx-agent/pkg/monitors/docker | |
| run: | | |
| go test -v -tags=dockerd -timeout 3m ./... |