You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by we...@apache.org on 2020/07/09 04:15:26 UTC

[incubator-apisix] branch master updated: feature: using GitHub action for CI (#1793)

This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 0e517a2  feature: using GitHub action for CI (#1793)
0e517a2 is described below

commit 0e517a25d66c975ccafc2112df2003e14ff009ab
Author: Raisinata <43...@users.noreply.github.com>
AuthorDate: Thu Jul 9 12:15:17 2020 +0800

    feature: using GitHub action for CI (#1793)
---
 .github/workflows/build.yml       | 64 +++++++++++++++++++++++++++++++++++++++
 .travis.yml                       |  2 ++
 .travis/linux_openresty_runner.sh |  2 +-
 .travis/linux_tengine_runner.sh   |  2 +-
 t/node/remote-addr-ipv6.t         | 10 +++---
 5 files changed, 73 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..df044a5
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,64 @@
+name: CI
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+jobs:
+  build:
+    strategy:
+      fail-fast: false
+      matrix:
+        platform: [ubuntu-18.04]
+        os_name: [linux_openresty, linux_tengine, linux_apisix_master_luarocks, linux_apisix_current_luarocks]
+        include:
+          - platform: macos-latest
+            os_name: osx_openresty
+
+    runs-on: ${{ matrix.platform }}
+    env:
+      SERVER_NAME: ${{ matrix.os_name }}
+
+
+    steps:        
+      - name: Check out code
+        uses: actions/checkout@v2
+
+#----------------------------------------------------------------------------
+      - name: Linux Get dependencies
+        if: matrix.platform == 'ubuntu-18.04'
+        run: sudo apt install -y cpanminus build-essential libncurses5-dev libreadline-dev libssl-dev perl etcd
+
+      - name: Linux Before install
+        if: matrix.platform == 'ubuntu-18.04'
+        run: sudo ./.travis/${{ matrix.os_name }}_runner.sh before_install
+
+      - name: Linux Install
+        if: matrix.platform == 'ubuntu-18.04'
+        run: sudo ./.travis/${{ matrix.os_name }}_runner.sh do_install
+
+      - name: Linux Script
+        if: matrix.platform == 'ubuntu-18.04'
+        run: sudo ./.travis/${{ matrix.os_name }}_runner.sh script
+
+#       - name: Linux After success
+#         if: matrix.platform == 'ubuntu-18.04'
+#         run: sudo ./.travis/${{ matrix.os_name }}_runner.sh after_success
+#----------------------------------------------------------------------------
+      - name: MacOS Before install
+        if: matrix.platform == 'macos-latest'
+        run: ./.travis/${{ matrix.os_name }}_runner.sh before_install
+
+      - name: MacOS Install
+        if: matrix.platform == 'macos-latest'
+        run: ./.travis/${{ matrix.os_name }}_runner.sh do_install
+
+      - name: MacOS Script
+        if: matrix.platform == 'macos-latest'
+        run: ./.travis/${{ matrix.os_name }}_runner.sh script
+
+#       - name: MacOS After success
+#         if: matrix.platform == 'macos-latest'
+#         run: ./.travis/${{ matrix.os_name }}_runner.sh after_success
diff --git a/.travis.yml b/.travis.yml
index ddc6b89..ac7c27f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,6 +2,8 @@ dist: bionic
 sudo: required
 
 matrix:
+  allow_failures:
+    - os: osx
   include:
     - os: linux
       services:
diff --git a/.travis/linux_openresty_runner.sh b/.travis/linux_openresty_runner.sh
index 86505cf..4abb356 100755
--- a/.travis/linux_openresty_runner.sh
+++ b/.travis/linux_openresty_runner.sh
@@ -49,7 +49,7 @@ before_install() {
     docker pull bitinit/eureka
     docker run --name eureka -d -p 8761:8761 --env ENVIRONMENT=apisix --env spring.application.name=apisix-eureka --env server.port=8761 --env eureka.instance.ip-address=127.0.0.1 --env eureka.client.registerWithEureka=true --env eureka.client.fetchRegistry=false --env eureka.client.serviceUrl.defaultZone=http://127.0.0.1:8761/eureka/ bitinit/eureka
     sleep 5
-    docker exec -it kafka-server1 /opt/bitnami/kafka/bin/kafka-topics.sh --create --zookeeper zookeeper-server:2181 --replication-factor 1 --partitions 1 --topic test2
+    docker exec -i kafka-server1 /opt/bitnami/kafka/bin/kafka-topics.sh --create --zookeeper zookeeper-server:2181 --replication-factor 1 --partitions 1 --topic test2
 }
 
 do_install() {
diff --git a/.travis/linux_tengine_runner.sh b/.travis/linux_tengine_runner.sh
index fb9b6fd..2f11aa5 100755
--- a/.travis/linux_tengine_runner.sh
+++ b/.travis/linux_tengine_runner.sh
@@ -50,7 +50,7 @@ before_install() {
     docker pull bitinit/eureka
     docker run --name eureka -d -p 8761:8761 --env ENVIRONMENT=apisix --env spring.application.name=apisix-eureka --env server.port=8761 --env eureka.instance.ip-address=127.0.0.1 --env eureka.client.registerWithEureka=true --env eureka.client.fetchRegistry=false --env eureka.client.serviceUrl.defaultZone=http://127.0.0.1:8761/eureka/ bitinit/eureka
     sleep 5
-    docker exec -it kafka-server1 /opt/bitnami/kafka/bin/kafka-topics.sh --create --zookeeper zookeeper-server:2181 --replication-factor 1 --partitions 1 --topic test2
+    docker exec -i kafka-server1 /opt/bitnami/kafka/bin/kafka-topics.sh --create --zookeeper zookeeper-server:2181 --replication-factor 1 --partitions 1 --topic test2
 }
 
 tengine_install() {
diff --git a/t/node/remote-addr-ipv6.t b/t/node/remote-addr-ipv6.t
index fdc469d..26e4830 100644
--- a/t/node/remote-addr-ipv6.t
+++ b/t/node/remote-addr-ipv6.t
@@ -108,17 +108,17 @@ location /t {
 }
 --- request
 GET /t
---- response_body
-connected: 1
+--- response_body eval
+qr{connected: 1
 request sent: 59
 received: HTTP/1.1 200 OK
 received: Content-Type: text/plain
 received: Connection: close
-received: Server: openresty
+received: Server: \w+
 received: 
 received: hello world
-failed to receive a line: closed []
-close: 1 nil
+failed to receive a line: closed \[\]
+close: 1 nil}
 --- no_error_log
 [error]