forked from apache/incubator-devlake
-
Notifications
You must be signed in to change notification settings - Fork 1
117 lines (115 loc) · 3.38 KB
/
test-e2e.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
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This action run e2e test for pull requests
name: test-e2e
on:
push:
branches: [main]
pull_request:
branches: [main, release-*]
paths:
- "**.go"
- '**.py'
- '**.toml'
- '**.sh'
- "Makefile"
- "go.mod"
- "go.sum"
- ".github/workflows/*.yml"
- "test/**"
- "e2e/**"
- "devops/**"
jobs:
e2e-mysql:
runs-on: ubuntu-latest
services:
db:
image: mysql:8
env:
MYSQL_DATABASE: lake
MYSQL_USER: merico
MYSQL_PASSWORD: merico
MYSQL_ROOT_PASSWORD: root
container: mericodev/lake-builder:latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- run: git config --global --add safe.directory $(pwd)
- name: Build Python
run: |
cd backend
echo "Building Python"
make build-python
- name: Cache test-e2e
id: cache-test-e2e
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
${{ env.GOPATH }}/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test-mysql
env:
DB_URL: mysql://root:root@db:3306/lake?charset=utf8mb4&parseTime=True
E2E_DB_URL: mysql://root:root@db:3306/lake?charset=utf8mb4&parseTime=True
run: |
go version
cp env.example .env
cd backend
make e2e-test-go-plugins
make e2e-test
e2e-postgres:
runs-on: ubuntu-latest
services:
db:
image: postgres:14.2
env:
POSTGRES_DB: lake
POSTGRES_USER: merico
POSTGRES_PASSWORD: merico
container: mericodev/lake-builder:latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- run: git config --global --add safe.directory $(pwd)
- name: Build Python
run: |
cd backend
echo "Building Python"
make build-python
- name: Cache test-e2e-pg
id: cache-test-e2e-pg
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
${{ env.GOPATH }}/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test-pg
env:
DB_URL: postgres://merico:merico@db:5432/lake
E2E_DB_URL: postgres://merico:merico@db:5432/lake
run: |
go version
cp env.example .env
cd backend
make e2e-test-go-plugins
make e2e-test