Skip to content

refactor: share sqlite close helper across storage packages #303

refactor: share sqlite close helper across storage packages

refactor: share sqlite close helper across storage packages #303

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.26.x'
cache-dependency-path: go.sum
- name: Download dependencies
run: go mod download
- name: Run tests
run: go test -v -race -tags='!integration' -covermode=atomic -coverpkg=./... -coverprofile=coverage.out ./...
- name: Generate coverage report
run: |
go tool cover -func=coverage.out
go tool cover -html=coverage.out -o coverage.html
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: |
coverage.out
coverage.html
retention-days: 7
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Needed by .golangci.yml `issues.new-from-rev: origin/main`
# so lint checks only new violations introduced by the PR.
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.26.x'
cache-dependency-path: go.sum
- name: Run golangci-lint
id: golangci
uses: golangci/golangci-lint-action@v7
with:
version: latest
working-directory: .
skip-cache: true
skip-save-cache: true
args: --timeout=10m --output.json.path=lint-report.json --output.html.path=lint-report.html
- name: Upload lint reports
if: failure() && steps.golangci.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: golangci-lint-reports
path: |
lint-report.json
lint-report.html
retention-days: 7
build-check:
name: Build Check
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin, windows]
goarch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.26.x'
cache-dependency-path: go.sum
- name: Build binaries
run: |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} \
go build -ldflags="-s -w" -o /dev/null ./cmd/cr-api