-
Notifications
You must be signed in to change notification settings - Fork 127
129 lines (125 loc) · 3.92 KB
/
integration_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Go
on:
workflow_call:
push:
branches:
- master
pull_request:
env:
TEST_RESULTS: /tmp/test-results # path to where test results will be saved
GH_ACTIONS: "1"
GO_VERSION: "1.21.6"
ACTIONS_STEP_DEBUG: true
jobs:
initialize_data:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Verify go version
run: go version
- name: Init database
run: |
cd tests
go run ./init/init.go -testsuite mysql
# go run ./init/init.go -testsuite all
- name: CWD
run: pwd
- name: list
run: ls -lha tests
- uses: actions/upload-artifact@v4
with:
name: testData
path: ${{ github.workspace }}/tests/.gentestdata/
validate_test:
needs: initialize_data
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: testData
path: ${{ github.workspace }}/tests/.gentestdata/
- name: CWD
run: pwd
- name: list
run: ls -lha tests
# maria_test:
# needs: initialize_data
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v4
# with:
# name: testData
# path: ./tests/.gentestdata
# # run mariaDB and cockroachdb tests. No need to collect coverage, because coverage is already included with mysql and postgres tests
# - name: Run MariaDB tests
# run: MY_SQL_SOURCE=MariaDB go test -v ./tests/mysql/
# couchdb_test:
# needs: initialize_data
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v4
# with:
# name: generated-data
# path: tests/.gentestdata
# - name: Run cockroach DB
# run: PG_SOURCE=COCKROACH_DB go test -v ./tests/postgres/
# standard_test:
# needs: initialize_data
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v4
# with:
# name: generated-data
# overwrite: true
# path: |
# tests/.gentestdata
# ./tests/.gentestdata
# ./.gentestdata
## - name: Checkout Repository
## uses: actions/checkout@v4
## with:
## submodules: 'true'
## - name: Set up Go
## uses: actions/setup-go@v5
## with:
## go-version: $GO_VERSION
## - name: Install GoTest
## run: go install gotest.tools/gotestsum@latest
## - uses: actions/download-artifact@master
## with:
## name: my-artifact
## path: tests/.gentestdata
# # to create test results report
# - name: Install go-junit-report
# run: go install github.com/jstemmer/go-junit-report@latest
# - name: Setup Test Report Dir
# run: mkdir -p $TEST_RESULTS
# # this will run all tests and exclude test files from code coverage report
# - name: Run Tests
# run: |
# go test -v ./... \
# -covermode=atomic \
# -coverpkg=github.com/go-jet/jet/v2/postgres/...,github.com/go-jet/jet/v2/mysql/...,github.com/go-jet/jet/v2/sqlite/...,github.com/go-jet/jet/v2/qrm/...,github.com/go-jet/jet/v2/generator/...,github.com/go-jet/jet/v2/internal/... \
# -coverprofile=cover.out 2>&1 | go-junit-report > $TEST_RESULTS/results.xml
# - name: Archive code coverage results
# uses: actions/upload-artifact@v4
# with:
# name: code-coverage-report
# path: $TEST_RESULTS/results.xml
# - name: Store cover.out
# uses: actions/upload-artifact@v4
# with:
# name: cover.out
# path: cover.out
# - name: Store test-results
# uses: actions/upload-artifact@v4
# with:
# name: test-results
# path: /tmp/test-results