Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

test: more cases

test: more cases #13

Workflow file for this run

name: tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
sqlite:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.19
- run: GORM_DIALECT=sqlite go build --tags "json1" -v ./...
- run: GORM_DIALECT=sqlite go test --tags "json1" -race -covermode=atomic -coverprofile=coverage.out -v ./...
- uses: paambaati/codeclimate-action@v3.0.0
continue-on-error: true
env:
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TOKEN }}
with:
coverageCommand: ''
prefix: 'github.com/brokeyourbike/jsonarray'
coverageLocations: ./coverage.out:gocov
mysql:
strategy:
matrix:
dbversion: ['mysql:latest', 'mysql:5.7', 'mariadb:latest']
runs-on: ubuntu-latest
timeout-minutes: 5
services:
mysql:
image: ${{ matrix.dbversion }}
env:
MYSQL_DATABASE: gorm
MYSQL_USER: gorm
MYSQL_PASSWORD: gorm
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
ports:
- 9910:3306
options: >-
--health-cmd "mysqladmin ping -ugorm -pgorm"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.19
- run: GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True" go build -v ./...
- run: GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True" go test -race -covermode=atomic -coverprofile=coverage.out -v ./...
- uses: paambaati/codeclimate-action@v3.0.0
continue-on-error: true
env:
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TOKEN }}
with:
coverageCommand: ''
prefix: 'github.com/brokeyourbike/jsonarray'
coverageLocations: ./coverage.out:gocov