changed mongodb repository to accept any interface #16
This file contains 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: Test | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- '**.go' | |
- 'go.mod' | |
- 'go.sum' | |
- '.github/workflows/test.yml' | |
pull_request: | |
branches: [ main ] | |
paths: | |
- '**.go' | |
- 'go.mod' | |
- 'go.sum' | |
- '.github/workflows/test.yml' | |
jobs: | |
test: | |
name: Run Tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: ['1.22'] | |
services: | |
mongodb: | |
image: mongo:latest | |
ports: | |
- 27017:27017 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
cache: true | |
- name: Install dependencies | |
run: go mod download | |
- name: Run tests | |
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.txt | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} |