Skip to content

Commit a534f4d

Browse files
author
Saeid Saeidee
committed
ci: added build & test job
1 parent 8a56aca commit a534f4d

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

.github/workflows/tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
- '*'
8+
pull_request:
9+
branches:
10+
- master
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
run-tests:
17+
strategy:
18+
matrix:
19+
go: ['1.19', '1.18', '1.17']
20+
platform: [ubuntu-latest]
21+
runs-on: ubuntu-latest
22+
services:
23+
mssql:
24+
image: mcmoe/mssqldocker:latest
25+
env:
26+
ACCEPT_EULA: Y
27+
SA_PASSWORD: LoremIpsum86
28+
MSSQL_DB: gorm
29+
MSSQL_USER: gorm
30+
MSSQL_PASSWORD: LoremIpsum86
31+
ports:
32+
- 9930:1433
33+
34+
steps:
35+
- name: Set up Go 1.x
36+
uses: actions/setup-go@v4
37+
with:
38+
go-version: ${{ matrix.go }}
39+
40+
- name: Check out code into the Go module directory
41+
uses: actions/checkout@v3
42+
43+
# Run build of the application
44+
- name: Run build
45+
run: go build .
46+
47+
- name: Run tests
48+
run: go test -race -count=1 -v ./...

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
7979
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
8080
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
8181
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
82-
gorm.io/gorm v1.24.0 h1:j/CoiSm6xpRpmzbFJsQHYj+I8bGYWLXVHeYEyyKlF74=
83-
gorm.io/gorm v1.24.0/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA=
82+
gorm.io/gorm v1.25.1 h1:nsSALe5Pr+cM3V1qwwQ7rOkw+6UeLrX5O4v3llhHa64=
83+
gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=

0 commit comments

Comments
 (0)