Skip to content

[ansible][windows] Add option to set service CLI args #13875

[ansible][windows] Add option to set service CLI args

[ansible][windows] Add option to set service CLI args #13875

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.23.10
jobs:
tidy:
name: tidy
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-environment
- name: tidy
run: |
make for-all CMD="make tidy"
if ! git diff --exit-code; then
echo "One or more Go files are not tidied. Run 'make for-all CMD=\"make tidy\"' and push the changes."
exit 1
fi
gofmt:
name: gofmt
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-environment
- name: gofmt
run: |
make for-all CMD="make fmt"
if ! git diff --exit-code; then
echo "One or more Go files are not formatted correctly. Run 'make for-all CMD="make fmt"' and push the changes."
exit 1
fi
generate-metrics:
name: generate-metrics
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- 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@v4
- uses: ./.github/actions/setup-environment
- run: echo "GOLANGCI_LINT_CACHE=${HOME}/.cache/golangci-lint" >> "$GITHUB_ENV"
- uses: actions/cache@v4
with:
path: ${{ env.GOLANGCI_LINT_CACHE }}
key: golangci-lint-${{ hashFiles('**/.golangci.yml', '**/*.go', '**/go.sum') }}
- name: Lint
run: |
make for-all CMD="make lint"
actionlint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Download actionlint
id: get_actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/03d0035/scripts/download-actionlint.bash) # v1.7.7
shell: bash
- name: Check workflow files
run: ${{ steps.get_actionlint.outputs.executable }} -color
shell: bash
test:
name: unit-test
strategy:
matrix:
# The "macos-13-xlarge" runner is arm64: https://github.com/actions/runner-images/issues/8439
OS: [ "ubuntu-24.04", "macos-13", "macos-13-xlarge", "macos-14", "macos-15" ]
uses: ./.github/workflows/unit-test.yml
with:
OS: ${{ matrix.OS }}
COVERAGE: true
secrets: inherit
coverage:
name: coverage
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-environment
- name: Run Unit Tests With Coverage
run: make gotest-with-codecov
- name: Upload coverage report
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # 5.4.3
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-linux_ppc64le" ]
uses: ./.github/workflows/compile.yml
with:
SYS_BINARY: ${{ matrix.SYS_BINARIES }}