-
Notifications
You must be signed in to change notification settings - Fork 312
150 lines (143 loc) · 4.73 KB
/
regular-build.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
145
146
147
148
149
150
# 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: Lint and build regularly
on:
push:
paths:
- '.github/workflows/regular-build.yml'
branches:
- master
- 'v[0-9]+.*' # release branch
- ci-test # testing branch for github action
- '*dev' # developing branch
# for manually triggering workflow
workflow_dispatch:
# run for every day 2am UTC+8(Beijing)
schedule:
- cron: '0 18 */1 * *'
jobs:
lint_cpp:
name: Lint Cpp
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: clang-format
run: ./build_tools/run-clang-format.py --clang-format-executable clang-format-14 -e ./src/shell/linenoise -e ./src/shell/sds -e ./thirdparty -r .
build_cpp:
name: Build Cpp
runs-on: ubuntu-latest
env:
# The glibc version on ubuntu1804 and centos7 is lower than the node20 required, so
# we need to force the node version to 16.
# See more details: https://github.com/actions/checkout/issues/1809
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
strategy:
fail-fast: false
matrix:
os:
- ubuntu1804
- ubuntu2004
- ubuntu2204
- centos7
compiler:
- "gcc,g++"
include:
- compiler: "clang-14,clang++-14"
os: ubuntu2204
- compiler: "clang-10,clang++-10"
os: ubuntu2004
- compiler: "clang-9,clang++-9"
os: ubuntu1804
container:
image: apache/pegasus:thirdparties-bin-${{ matrix.os }}-${{ github.ref_name }}
defaults:
run:
working-directory: /root/incubator-pegasus
steps:
- name: Clone Apache Pegasus Source
# The glibc version on ubuntu1804 and centos7 is lower than the actions/checkout@v4 required, so
# we need to force to use actions/checkout@v3.
uses: actions/checkout@v3
- name: Unpack prebuilt third-parties
uses: "./.github/actions/unpack_prebuilt_thirdparties"
- name: Build Pegasus
uses: "./.github/actions/build_pegasus"
build_and_lint_go:
name: Build and Lint Golang
runs-on: ubuntu-20.04
steps:
- name: Install thrift
# go-client imports thrift package of 0.13.0, so we must use thrift-compiler 0.13.0
# to generate code as well. The thrift-compiler version on ubuntu-20.04 is 0.13.0
run: sudo apt-get install -y thrift-compiler
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Build go-client
run: make
working-directory: ./go-client
- name: Lint go-client
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
working-directory: ./go-client
- name: Build admin-cli
run: make
working-directory: ./admin-cli
- name: Lint admin-cli
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
working-directory: ./admin-cli
- name: Build pegic
run: make
working-directory: ./pegic
- name: Lint pegic
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
working-directory: ./pegic
build_java:
name: Build Java
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8', '11']
steps:
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/checkout@v4
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Download thrift
working-directory: ./java-client/scripts
run: ./download_thrift.sh
- name: Build
working-directory: ./java-client
run: |
mvn spotless:apply
mvn clean package -DskipTests