Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

chore: update ci from travis to github-action #163

Merged
merged 20 commits into from
Jul 27, 2021
Merged
51 changes: 51 additions & 0 deletions .github/workflows/ci-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# 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: CI - Test
on:
pull_request:
branches:
- master
- 'v[0-9]+.*' # release branch
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
test:
name: test
runs-on: ubuntu-latest
foreverneverer marked this conversation as resolved.
Show resolved Hide resolved
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@v2
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: ci
run: ./scripts/ci-test.sh
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ For each type of request(get, set, multiset, etc.), we collect 8 metrics:

We use io.dropwizard.metrics library to calculate the request count.

Currently, metrics are integrated with open-falcon(http://open-falcon.com/),
which push counters to local http agent http://127.0.0.1:1988/push/v1.
Currently, metrics are integrated with open-falcon(http://open-falcon.com/),
which push counters to local http agent http://127.0.0.1:1988/push/v1.

If you'd like to integrate pegasus client with other monitor system, please let us know ASAP.
44 changes: 44 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.12.2</version>
</dependency>
</dependencies>
<reporting>
<plugins>
Expand Down Expand Up @@ -390,6 +395,45 @@
<version>0.13</version>
</plugin>

<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.12.2</version>
<configuration>
<formats>
<format>
<includes>
<include>*.md</include>
<include>.gitignore</include>
</includes>
<trimTrailingWhitespace/>
<endWithNewline/>
<indent>
<tabs>true</tabs>
<spacesPerTab>4</spacesPerTab>
</indent>
</format>
</formats>
<java>
<excludes>
<exclude>src/main/java/com/xiaomi/infra/pegasus/apps/*</exclude>
<exclude>src/main/java/com/xiaomi/infra/pegasus/replication/*</exclude>
</excludes>
<googleJavaFormat>
<version>1.7</version>
<style>GOOGLE</style>
</googleJavaFormat>
</java>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
17 changes: 7 additions & 10 deletions scripts/travis.sh → scripts/ci-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,19 @@ function shellcheck_must_pass()
exit 1
fi
}
shellcheck_must_pass ./scripts/format-all.sh
shellcheck_must_pass ./scripts/travis.sh

# ensure source files are well formatted
./scripts/format-all.sh
if [[ $(git status -s) ]]; then
git status -s
echo "please format the above files before commit"
exit 1
fi
shellcheck_must_pass ./scripts/ci-test.sh

# The new version of pegasus client is not compatible with old version server which contains old rpc protocol,
# So we use snapshot version of pegasus-tools, because we don`t have a new release version, which contains the new version of rpc protocol,
PEGASUS_PKG="pegasus-tools-2.0.0-5d969e8-glibc2.12-release"
PEGASUS_PKG_URL="https://github.com/apache/incubator-pegasus/releases/download/v2.0.0/pegasus-tools-2.0.0-5d969e8-glibc2.12-release.tar.gz"

# check format
if ! mvn spotless:check
then
exit 1
fi

# start pegasus onebox environment
if [ ! -f $PEGASUS_PKG.tar.gz ]; then
wget $PEGASUS_PKG_URL
Expand Down
48 changes: 0 additions & 48 deletions scripts/format-all.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public void testDNSMetaUnavailable() {
.build());
MetaSession metaMock = Mockito.spy(manager.getMetaSession());
List<ReplicaSession> metaList = metaMock.getMetaList();
metaList.remove(0); // del the "localhost:34601"
metaList.clear(); // del the "localhost:34601" resolve right results
metaList.add(manager.getReplicaSession(rpc_address.fromIpPort("172.0.0.1:34602")));
metaList.add(manager.getReplicaSession(rpc_address.fromIpPort("172.0.0.1:34603")));
metaList.add(manager.getReplicaSession(rpc_address.fromIpPort("172.0.0.1:34601")));
Expand Down