mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-05 13:37:34 +08:00
83651715a6
Co-authored-by: leslie <59061168+leslie-tsang@users.noreply.github.com>
117 lines
3.7 KiB
YAML
117 lines
3.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master, 'release/**']
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
- '**/*.md'
|
|
pull_request:
|
|
branches: [master]
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
- '**/*.md'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform:
|
|
- ubuntu-18.04
|
|
os_name:
|
|
- linux_openresty
|
|
- linux_openresty_1_17
|
|
- linux_openresty_mtls
|
|
- linux_tengine
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
timeout-minutes: 90
|
|
env:
|
|
SERVER_NAME: ${{ matrix.os_name }}
|
|
OPENRESTY_VERSION: default
|
|
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v2.3.5
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v2.1.4
|
|
with:
|
|
go-version: "1.15"
|
|
|
|
- name: Cache deps
|
|
uses: actions/cache@v2.1.6
|
|
env:
|
|
cache-name: cache-deps
|
|
with:
|
|
path: deps
|
|
key: ${{ runner.os }}-${{ env.cache-name }}-${{ matrix.os_name }}-${{ hashFiles('rockspec/apisix-master-0.rockspec') }}
|
|
|
|
- name: Extract branch name
|
|
if: ${{ startsWith(github.ref, 'refs/heads/release/') }}
|
|
id: branch_env
|
|
shell: bash
|
|
run: |
|
|
echo "##[set-output name=version;]$(echo ${GITHUB_REF##*/})"
|
|
echo "##[set-output name=fullname;]$(echo apache-apisix-${GITHUB_REF##*/}-src.tgz)"
|
|
|
|
- name: Linux launch common services
|
|
run: |
|
|
make ci-env-up project_compose_ci=ci/pod/docker-compose.common.yml
|
|
|
|
- name: Create tarball
|
|
if: ${{ startsWith(github.ref, 'refs/heads/release/') }}
|
|
run: |
|
|
make compress-tar project_version=${{ steps.branch_env.outputs.version }}
|
|
|
|
- name: Remove source code
|
|
if: ${{ startsWith(github.ref, 'refs/heads/release/') }}
|
|
run: |
|
|
rm -rf $(ls -1 --ignore=*.tgz --ignore=ci --ignore=t --ignore=utils --ignore=.github)
|
|
tar zxvf ${{ steps.branch_env.outputs.fullname }}
|
|
|
|
- name: Linux Get dependencies
|
|
run: sudo apt install -y cpanminus build-essential libncurses5-dev libreadline-dev libssl-dev perl libpcre3 libpcre3-dev libldap2-dev
|
|
|
|
- name: Build wasm code
|
|
if: startsWith(matrix.os_name, 'linux_openresty')
|
|
run: |
|
|
export TINYGO_VER=0.20.0
|
|
wget https://github.com/tinygo-org/tinygo/releases/download/v${TINYGO_VER}/tinygo_${TINYGO_VER}_amd64.deb 2>/dev/null
|
|
sudo dpkg -i tinygo_${TINYGO_VER}_amd64.deb
|
|
cd t/wasm && find . -type f -name "main.go" | xargs -Ip tinygo build -o p.wasm -scheduler=none -target=wasi p
|
|
|
|
- name: Linux Before install
|
|
run: sudo ./ci/${{ matrix.os_name }}_runner.sh before_install
|
|
|
|
- name: Start Dubbo Backend
|
|
if: matrix.os_name == 'linux_openresty'
|
|
run: |
|
|
sudo apt install -y maven
|
|
cd t/lib/dubbo-backend
|
|
mvn package
|
|
cd dubbo-backend-provider/target
|
|
java -Djava.net.preferIPv4Stack=true -jar dubbo-demo-provider.one-jar.jar > /tmp/java.log &
|
|
|
|
- name: Linux Install
|
|
run: |
|
|
sudo --preserve-env=OPENRESTY_VERSION \
|
|
./ci/${{ matrix.os_name }}_runner.sh do_install
|
|
|
|
- name: Linux Script
|
|
run: sudo ./ci/${{ matrix.os_name }}_runner.sh script
|
|
|
|
- name: Publish Artifact
|
|
if: ${{ startsWith(github.ref, 'refs/heads/release/') && matrix.os_name == 'linux_openresty' }}
|
|
uses: actions/upload-artifact@v2.2.4
|
|
with:
|
|
name: ${{ steps.branch_env.outputs.fullname }}
|
|
path: ${{ steps.branch_env.outputs.fullname }}
|