Skip to content

Merge pull request #32 from DataDog/dependabot/github_actions/gh-acti… #144

Merge pull request #32 from DataDog/dependabot/github_actions/gh-acti…

Merge pull request #32 from DataDog/dependabot/github_actions/gh-acti… #144

Workflow file for this run

name: CI
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v5
with:
go-version: "1.24.x"
- name: Cache Go modules
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-1.24-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-1.24-
- name: Download dependencies
run: go mod download
- name: Verify dependencies
run: go mod verify
- name: Format check
run: |
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
echo "The following files are not formatted correctly:"
gofmt -s -l .
exit 1
fi
- name: Vet
run: go vet ./...
- name: Run tests
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v5
with:
go-version: "1.24.x"
- name: golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v6
with:
version: latest
args: --timeout=5m