-
Notifications
You must be signed in to change notification settings - Fork 48
165 lines (135 loc) · 4.38 KB
/
tests.yaml
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
IMAGE_SHARD: spqr-shard-image
SHARD_CACHE_KEY: sha256sum-of-docker-shard
CACHE_FILE_SHARD: ~/spqr-shard-image-shard-cache-key.tgz
jobs:
unit:
name: unit
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: unit tests
run: make unittest
stress:
name: stress
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: stress tests
run: make stress
regress:
name: regress
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: regress tests
run: |
POSTGRES_VERSION=12 make regress
POSTGRES_VERSION=13 make regress
POSTGRES_VERSION=14 make regress
POSTGRES_VERSION=15 make regress
gorm-regress:
name: drivers_gorm
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Run tests
run: make gorm_regress
xproto-regress:
name: xproto
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Run tests
run: make xproto_regress
feature_prepare:
name: feature_prepare
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.step1.outputs.features }}
steps:
- name: Check Docker Version
run: docker --version
- name: Check out code
uses: actions/checkout@v4
- id: step1
run: |
make split_feature_test
array=$(find test/feature/generatedFeatures -type f -exec wc -l {} \; | sort -rn | awk '{printf $0"\n"}' | python3 .github/scenario_balancer.py)
echo "features=$(echo "{\"command\": $array}")" >> $GITHUB_OUTPUT
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: generated_tests
path: |
./test/feature/generatedFeatures
- name: Update env
run: |
SHARD_CACHE_KEY="spqr-shard-image-$(git rev-parse HEAD)"
CACHE_FILE_SHARD="~/$SHARD_CACHE_KEY.tgz"
echo "SHARD_CACHE_KEY=$SHARD_CACHE_KEY" >> $GITHUB_ENV
echo "CACHE_FILE_SHARD=$CACHE_FILE_SHARD" >> $GITHUB_ENV
# use cache to pass docker images to the test jobs
- name: Docker shard image caching
id: cache-shard-image
uses: actions/cache@v4
with:
path: |
${{ env.CACHE_FILE_SHARD }}
key: ${{ env.SHARD_CACHE_KEY }}
# build images
- name: Build shard image
if: steps.cache-shard-image.outputs.cache-hit != 'true'
run: make save_shard_image
feature:
name: feature
runs-on: ubuntu-latest
needs: feature_prepare
strategy:
matrix: ${{ fromJson(needs.feature_prepare.outputs.output1) }}
# do not cancel all tests if one failed
fail-fast: false
steps:
- name: Install Latest Docker
run: |
for pkg in docker.io docker-doc podman-docker containerd runc; do sudo apt-get remove $pkg; done
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- name: Check Docker Version
run: docker --version
- name: Check out code
uses: actions/checkout@v4
- name: Update env
run: |
SHARD_CACHE_KEY="spqr-shard-image-$(git rev-parse HEAD)"
CACHE_FILE_SHARD="~/$SHARD_CACHE_KEY.tgz"
echo "SHARD_CACHE_KEY=$SHARD_CACHE_KEY" >> $GITHUB_ENV
echo "CACHE_FILE_SHARD=$CACHE_FILE_SHARD" >> $GITHUB_ENV
- name: Download generatedFeatures
uses: actions/download-artifact@v4
with:
name: generated_tests
path: ./test/feature/generatedFeatures
# load docker images
- name: Load shard image
id: cache-shard-image
uses: actions/cache@v4
with:
path: |
${{ env.CACHE_FILE_SHARD }}
key: ${{ env.SHARD_CACHE_KEY }}
- name: feature tests
run: ${{ matrix.command }}