From 15f883ed9537df93f99edba975380e7d9039a7b1 Mon Sep 17 00:00:00 2001 From: Tom <73077675+tmzane@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:06:36 +0500 Subject: [PATCH] chore: add CI --- .github/workflows/checks.yml | 18 ++++++++++++++++++ .github/workflows/release.yml | 17 +++++++++++++++++ .golangci.yml | 22 ++++++++++++++++++++++ README.md | 5 +++++ 4 files changed, 62 insertions(+) create mode 100644 .github/workflows/checks.yml create mode 100644 .github/workflows/release.yml create mode 100644 .golangci.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..63377cd --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,18 @@ +name: checks + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + test: + uses: go-simpler/.github/.github/workflows/test.yml@main + with: + packages: '.' # ignore `internal/assert` + lint: + uses: go-simpler/.github/.github/workflows/lint.yml@main + vuln: + uses: go-simpler/.github/.github/workflows/vuln.yml@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b139ec4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,17 @@ +name: release + +on: + push: + tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ] + workflow_dispatch: + inputs: + version: + type: string + required: true + description: The next semantic version to release + +jobs: + release: + uses: go-simpler/.github/.github/workflows/release.yml@main + with: + version: ${{ github.event_name == 'push' && github.ref_name || inputs.version }} diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..ef926a0 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,22 @@ +linters: + disable-all: true + enable: + # enabled by default: + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - unused + # disabled by default: + - gocritic + - gofumpt + +linters-settings: + gocritic: + enabled-tags: + - diagnostic + - style + - performance + - experimental + - opinionated diff --git a/README.md b/README.md index 4a21fc4..5f1f2c9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # queries +[![checks](https://github.com/go-simpler/queries/actions/workflows/checks.yml/badge.svg)](https://github.com/go-simpler/queries/actions/workflows/checks.yml) +[![pkg.go.dev](https://pkg.go.dev/badge/go-simpler.org/queries.svg)](https://pkg.go.dev/go-simpler.org/queries) +[![goreportcard](https://goreportcard.com/badge/go-simpler.org/queries)](https://goreportcard.com/report/go-simpler.org/queries) +[![codecov](https://codecov.io/gh/go-simpler/queries/branch/main/graph/badge.svg)](https://codecov.io/gh/go-simpler/queries) + [WIP] Convenience helpers for working with SQL queries. ## Features