2020-10-28 23:41:14 +08:00
|
|
|
name: CI Linux
|
2020-07-09 12:15:17 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2020-10-30 08:34:03 +08:00
|
|
|
platform:
|
|
|
|
- ubuntu-18.04
|
|
|
|
os_name:
|
|
|
|
- linux_openresty
|
2020-11-30 10:32:35 +08:00
|
|
|
- linux_openresty_1_17
|
2020-10-30 08:34:03 +08:00
|
|
|
- linux_tengine
|
|
|
|
- linux_apisix_master_luarocks
|
|
|
|
- linux_apisix_current_luarocks
|
|
|
|
- linux_openresty_mtls
|
2020-07-09 12:15:17 +08:00
|
|
|
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
env:
|
|
|
|
SERVER_NAME: ${{ matrix.os_name }}
|
2020-11-30 10:32:35 +08:00
|
|
|
OPENRESTY_VERSION: default
|
2020-07-09 12:15:17 +08:00
|
|
|
|
|
|
|
|
2020-10-28 23:41:14 +08:00
|
|
|
services:
|
|
|
|
etcd:
|
|
|
|
image: bitnami/etcd:3.4.0
|
|
|
|
ports:
|
|
|
|
- 2379:2379
|
|
|
|
- 2380:2380
|
|
|
|
env:
|
|
|
|
ALLOW_NONE_AUTHENTICATION: yes
|
|
|
|
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
|
|
|
|
|
2020-11-24 18:48:45 +08:00
|
|
|
old_etcd:
|
|
|
|
image: bitnami/etcd:3.3.8
|
|
|
|
ports:
|
|
|
|
- 3379:2379
|
|
|
|
- 3380:2380
|
|
|
|
env:
|
|
|
|
ALLOW_NONE_AUTHENTICATION: yes
|
|
|
|
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
|
|
|
|
|
2020-07-17 15:27:08 +08:00
|
|
|
steps:
|
2020-07-09 12:15:17 +08:00
|
|
|
- name: Check out code
|
|
|
|
uses: actions/checkout@v2
|
2020-11-30 10:32:35 +08:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2020-07-09 12:15:17 +08:00
|
|
|
|
|
|
|
- name: Linux Get dependencies
|
2020-10-28 23:41:14 +08:00
|
|
|
run: sudo apt install -y cpanminus build-essential libncurses5-dev libreadline-dev libssl-dev perl
|
2020-07-09 12:15:17 +08:00
|
|
|
|
|
|
|
- name: Linux Before install
|
|
|
|
run: sudo ./.travis/${{ matrix.os_name }}_runner.sh before_install
|
|
|
|
|
2020-10-17 08:21:47 +08:00
|
|
|
- name: Install Redis Cluster
|
2020-11-30 10:32:35 +08:00
|
|
|
if: matrix.os_name == 'linux_openresty' || matrix.os_name == 'linux_openresty_1_17'
|
2020-10-17 08:21:47 +08:00
|
|
|
uses: vishnudxb/redis-cluster@1.0.5
|
|
|
|
with:
|
|
|
|
master1-port: 5000
|
|
|
|
master2-port: 5001
|
|
|
|
master3-port: 5002
|
|
|
|
slave1-port: 5003
|
|
|
|
slave2-port: 5004
|
|
|
|
slave3-port: 5005
|
|
|
|
|
|
|
|
- name: Running Redis Cluster Test
|
2020-11-30 10:32:35 +08:00
|
|
|
if: matrix.os_name == 'linux_openresty' || matrix.os_name == 'linux_openresty_1_17'
|
2020-10-17 08:21:47 +08:00
|
|
|
run: |
|
|
|
|
sudo apt-get install -y redis-tools
|
|
|
|
docker ps -a
|
|
|
|
redis-cli -h 127.0.0.1 -p 5000 ping
|
|
|
|
redis-cli -h 127.0.0.1 -p 5000 cluster nodes
|
|
|
|
|
2020-11-03 13:53:39 +08:00
|
|
|
- name: Running etcd server with TLS
|
2020-11-30 10:32:35 +08:00
|
|
|
if: matrix.os_name == 'linux_openresty' || matrix.os_name == 'linux_openresty_1_17'
|
2020-11-03 13:53:39 +08:00
|
|
|
run: |
|
|
|
|
sudo docker run -d -p 12379:12379 -p 12380:12380 \
|
|
|
|
-e ALLOW_NONE_AUTHENTICATION=yes \
|
|
|
|
-e ETCD_ADVERTISE_CLIENT_URLS=https://0.0.0.0:12379 \
|
|
|
|
-e ETCD_LISTEN_CLIENT_URLS=https://0.0.0.0:12379 \
|
|
|
|
-e ETCD_CERT_FILE=/certs/etcd.pem \
|
|
|
|
-e ETCD_KEY_FILE=/certs/etcd.key \
|
|
|
|
-e GITHUB_ACTIONS=true \
|
|
|
|
-e CI=true \
|
|
|
|
-v ${{ github.workspace }}/t/certs:/certs \
|
|
|
|
bitnami/etcd:3.4.0
|
|
|
|
|
2020-07-09 12:15:17 +08:00
|
|
|
- name: Linux Install
|
2020-11-30 10:32:35 +08:00
|
|
|
run: |
|
|
|
|
sudo --preserve-env=OPENRESTY_VERSION \
|
|
|
|
./.travis/${{ matrix.os_name }}_runner.sh do_install
|
2020-07-09 12:15:17 +08:00
|
|
|
|
|
|
|
- name: Linux Script
|
|
|
|
run: sudo ./.travis/${{ matrix.os_name }}_runner.sh script
|