-
Notifications
You must be signed in to change notification settings - Fork 19
144 lines (121 loc) · 4.45 KB
/
ci.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#
# 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.
#
name: "Continuous Integration"
on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]
jobs:
build-be:
name: Build Backend
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
java: [ 8, 11 ]
language: [ 'java' ]
runs-on: ${{ matrix.os }}
services:
mysql:
image: mysql:8.0
env:
# The MySQL docker container requires these environment variables to be set, so we can create and migrate the test database.
MYSQL_DATABASE: eventmesh_dashboard_test
MYSQL_ROOT_PASSWORD: password
ports:
# https://docs.github.com/en/actions/using-containerized-services/about-service-containers
- 3306:3306
# Set health checks to wait until MySQL has started
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
ports:
- 6379:6379
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download middlewares
run: |
wget https://github.com/alibaba/nacos/releases/download/2.3.2/nacos-server-2.3.2.zip
unzip nacos-server-2.3.2.zip
wget https://dist.apache.org/repos/dist/release/rocketmq/4.9.8/rocketmq-all-4.9.8-bin-release.zip
unzip rocketmq-all-4.9.8-bin-release.zip
git clone https://github.com/apache/eventmesh.git
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 11
- name: Build EventMesh GenerateGrammarSource
working-directory: eventmesh
run: ./gradlew clean generateGrammarSource --parallel --daemon
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: ${{ matrix.java }}
cache: maven
- name: Build EventMesh Runtime
working-directory: eventmesh
run: ./gradlew clean dist -x spotlessJava -x generateGrammarSource --parallel --daemon && ./gradlew installPlugin
- name: Apply configuration file
run: cp .github/workflows/config/eventmesh.properties eventmesh/dist/conf/eventmesh.properties
- name: Set up Meta
working-directory: nacos
run: nohup bash bin/startup.sh -m standalone &
- name: Set up Event Store
working-directory: rocketmq-all-4.9.8-bin-release
run: |
nohup sh bin/mqnamesrv &
sleep 5
nohup sh bin/mqbroker -n localhost:9876 &
- name: Set up EventMesh Runtime
working-directory: eventmesh/dist
run: bash bin/start.sh
- name: Build Dashboard
run: ./mvnw -B package -DskipTests --file pom.xml
- name: Run Unit Tests
run: ./mvnw -B test --file pom.xml
build-fe:
name: Build Frontend
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm install --legacy-peer-deps
working-directory: ./eventmesh-dashboard-view
- name: Build
run: npm run build
working-directory: ./eventmesh-dashboard-view
# - name: Run tests
# run: npm test
# working-directory: ./eventmesh-dashboard-view