Skip to content

CI: update GitHub Actions and add dependabot #11

Description

@TopherGopher

Part of the easymongo refactor (see PLAN.md on the refactor branch).

Working context (read this first)

Scope

.github/workflows/go.yml:

  • actions/checkout and actions/setup-go at @v7 (both; verified 2026-09-09); setup-go with go-version-file: go.mod and check-latest: true.
  • Replace go get -v -t -d ./... (deprecated -d) with go mod download.
  • build job: gofmt -l . must print nothing, go vet ./..., go build ./....
  • test job: pre-pull mongo:8 for stable timings, then go test -v -race -covermode=atomic -coverpkg=./... -coverprofile=coverage.out ./... (Docker is available on ubuntu-latest; integration tests fail rather than skip when it is not).
  • Coverage conversion and upload with jandelgado/gcov2lcov-action@v1 and coverallsapp/github-action@v2.
  • Trigger on push to master and on pull requests.

New .github/dependabot.yml with gomod (weekly) and github-actions (weekly) ecosystems; the repo currently has none.

Implementation details

Workflow skeleton to adapt. Action versions verified on 2026-09-09 from each project's releases page: actions/checkout v7.0.1 (pin @v7), actions/setup-go v7.0.0 (pin @v7; supports the go-version-file and check-latest inputs), coverallsapp/github-action v2.3.8 (pin @v2), jandelgado/gcov2lcov-action v1.2.0 (pin @v1). Re-check the releases pages before merging in case a new major has shipped since.

name: Go
on:
  push: { branches: [master] }
  pull_request: { branches: [master] }
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-go@v7
        with: { go-version-file: go.mod, check-latest: true }
      - run: go mod download
      - run: test -z "$(gofmt -l .)"
      - run: go vet ./...
      - run: go build ./...
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-go@v7
        with: { go-version-file: go.mod, check-latest: true }
      - run: docker pull mongo:8
      - run: go test -v -race -covermode=atomic -coverpkg=./... -coverprofile=coverage.out ./...
      - uses: jandelgado/gcov2lcov-action@v1
        with: { infile: coverage.out, outfile: coverage.lcov }
      - uses: coverallsapp/github-action@v2
        with: { github-token: ${{ secrets.GITHUB_TOKEN }}, path-to-lcov: coverage.lcov }

.github/dependabot.yml:

version: 2
updates:
  - { package-ecosystem: gomod, directory: "/", schedule: { interval: weekly } }
  - { package-ecosystem: github-actions, directory: "/", schedule: { interval: weekly } }

Acceptance

  • CI green on the refactor branch; the README build and coverage badges keep working.

Depends on: #10.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions