Skip to content

fix: stop a running Windows service before uninstalling it #2371

fix: stop a running Windows service before uninstalling it

fix: stop a running Windows service before uninstalling it #2371

Workflow file for this run

---
name: build
# no paths-ignore on purpose: the build check is required, so a PR touching
# only ignored paths could never merge (the check would stay pending forever),
# and the asset linting in this workflow must run exactly when docs, scripts
# or install assets change
on:
workflow_dispatch: {}
push:
branches:
- main
- renovate/**
pull_request:
branches:
- main
# the default types miss the base-branch change of a retargeted PR (it
# arrives as "edited"), so a stacked PR that lands on main after its
# parent merges would never get a run. The job-level guard below skips
# the title/description edits that also arrive as "edited".
types:
- opened
- synchronize
- reopened
- edited
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euox pipefail {0}
# run edited-events only when the edit changed the base branch
jobs:
build:
if: github.event_name != 'pull_request' || github.event.action != 'edited' || github.event.changes.base != null
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v7.0.0
- name: Setup Go
uses: actions/setup-go@v7.0.0
with:
go-version-file: go.mod
- name: Check go.mod tidiness
run: go mod tidy --diff
- name: Run linters
uses: golangci/golangci-lint-action@v9.3.0
with:
# renovate: depName=golangci/golangci-lint datasource=github-releases
version: v2.12.2
args: --timeout=3m0s
install-mode: goinstall
- name: Set up Task
uses: arduino/setup-task@v3.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install asset linters
run: |
# renovate: depName=markdownlint-cli datasource=npm
npm install --global markdownlint-cli@0.49.1
# renovate: depName=mvdan.cc/sh/v3 datasource=go
go install mvdan.cc/sh/v3/cmd/shfmt@v3.13.1
# "go install" does not work on the dashboard-linter module (it has
# replace directives), so install the release binary. The version is
# a variable so renovate updates every occurrence in the URL at once.
# renovate: depName=grafana/dashboard-linter datasource=github-releases
DASHBOARD_LINTER_VERSION=0.2.0
curl -sSfL "https://github.com/grafana/dashboard-linter/releases/download/v${DASHBOARD_LINTER_VERSION}/dashboard-linter_${DASHBOARD_LINTER_VERSION}_linux_amd64.tar.gz" | tar -xz -C "$(go env GOPATH)/bin" dashboard-linter
- name: Lint markdown and shell scripts
run: task lint:assets
- name: Lint the Grafana dashboard
run: task lint:dashboard
- name: Run tests
run: go test -v -race -coverpkg=./... -coverprofile ./coverage.out -covermode=atomic -timeout 20m ./...
- name: Compile the GPU-tagged parity test # never runs in CI, must not rot between GPU box sessions
run: go test -run '^$' -tags gpu ./internal/integration/
- name: Print coverage results
run: go tool cover -func ./coverage.out
- name: Send coverage
uses: codecov/codecov-action@v7.0.0
with:
files: coverage.out
token: ${{ secrets.CODECOV_TOKEN }}
# a full snapshot release (unpublished) rather than a single-target
# build, so the packaging inputs (systemd unit, nfpm scriptlets) are
# validated in CI instead of failing for the first time on a real
# release
- name: Build and package with Goreleaser
uses: goreleaser/goreleaser-action@v7.2.3
with:
# renovate: depName=goreleaser/goreleaser datasource=github-releases
version: v2.17.0
args: release --snapshot --clean --skip=publish,docker,sign,sbom
env:
PRIVATE_ACCESS_TOKEN: placeholder
- name: Check for dirty files
run: git diff --exit-code
chart:
if: github.event_name != 'pull_request' || github.event.action != 'edited' || github.event.changes.base != null
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v7.0.0
with:
fetch-depth: 0
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.8.0
- name: Check that the chart dashboards match docs/grafana/
run: |
cmp docs/grafana/dashboard.json charts/nvidia-gpu-exporter/dashboards/nvidia-gpu-metrics.json
cmp docs/grafana/dashboard-overview.json charts/nvidia-gpu-exporter/dashboards/nvidia-gpu-overview.json
- name: Lint chart
run: ct lint --config .ct.yaml --all
- name: Check that the chart README is current
run: |
docker run --rm -v "$(pwd):/helm-docs" -u "$(id -u)" jnorwood/helm-docs:v1.14.2
git diff --exit-code charts/
- name: Create kind cluster
uses: helm/kind-action@v1.14.0
- name: Install chart
run: ct install --config .ct.yaml --all