QueryRow -> new interface #510
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: Check & test | |
on: | |
push: | |
branches: | |
- v3 | |
jobs: | |
check: | |
name: Quality & security checks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Run Revive Action by pulling pre-built image | |
uses: docker://morphy/revive-action:v2 | |
with: | |
config: revive.toml | |
- name: Run gocyclo | |
run: | | |
go clean -modcache | |
go mod tidy | |
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest | |
gocyclo -over 100 . | |
test: | |
name: Test & coverage | |
runs-on: ubuntu-latest | |
services: | |
dragonfly: | |
image: docker.dragonflydb.io/dragonflydb/dragonfly | |
ports: | |
- 6385:6379 | |
mysql: | |
image: mysql/mysql-server:8.0 | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_ROOT_HOST: "%" | |
ports: | |
- 3377:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=5s --health-retries=3 | |
steps: | |
- name: Configure sysctl limits | |
run: | | |
sudo swapoff -a | |
sudo sysctl -w vm.swappiness=1 | |
sudo sysctl -w fs.file-max=262144 | |
sudo sysctl -w vm.max_map_count=262144 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Create database | |
run: | | |
sudo apt-get update | |
mysql -uroot -h127.0.0.1 --port=3377 -proot -e 'CREATE DATABASE IF NOT EXISTS test;' | |
mysql -uroot -h127.0.0.1 --port=3377 -proot -e 'set global max_connections = 300;' | |
- name: Run unit tests with coverage. | |
run: | | |
export GOPATH=$(go env GOPATH) | |
go clean -modcache | |
go mod tidy | |
make cover | |
- name: Upload Coverage report to CodeCov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
file: ./resources/cover/cover.out |