This is an automated email from the ASF dual-hosted git repository. juzhiyuan pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git
The following commit(s) were added to refs/heads/master by this push: new 8e80033 CI: test make build (#1421) 8e80033 is described below commit 8e80033d31d036dd43eebea6acadf4a69e1acaee Author: kv <gxt...@163.com> AuthorDate: Sat Feb 6 05:20:09 2021 +0800 CI: test make build (#1421) --- .github/workflows/deploy-with-docker.yml | 2 +- .github/workflows/make-build.yaml | 47 ++++++++++++++++++++++ .../{docker_deploy_test.sh => manager_smoking.sh} | 39 +++++++++++++++--- 3 files changed, 82 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-with-docker.yml b/.github/workflows/deploy-with-docker.yml index 697e719..2ecdfe9 100644 --- a/.github/workflows/deploy-with-docker.yml +++ b/.github/workflows/deploy-with-docker.yml @@ -40,7 +40,7 @@ jobs: docker logs docker-deploy_managerapi_1 - name: Run Test - run: api/test/shell/docker_deploy_test.sh + run: api/test/shell/manager_smoking.sh -s false - name: Deploy if: ${{ github.event_name == 'push' }} diff --git a/.github/workflows/make-build.yaml b/.github/workflows/make-build.yaml new file mode 100644 index 0000000..4e6984f --- /dev/null +++ b/.github/workflows/make-build.yaml @@ -0,0 +1,47 @@ +name: make build + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + make-build-test: + name: make build test + runs-on: ubuntu-latest + + services: + etcd: + image: bitnami/etcd:3.4.13 + ports: + - 2379:2379 + - 2380:2380 + env: + ALLOW_NONE_AUTHENTICATION: yes + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Node.js environment + uses: actions/setup-node@v2.1.4 + with: + node-version: 14.x + + - name: Setup golang environment + uses: actions/setup-go@v2.1.3 + with: + go-version: '1.13' + + - name: make build + run: make build + + - name: start dashboard + working-directory: ./output + run: ./manager-api > ./api.log 2>&1 & + + - name: check + run: api/test/shell/manager_smoking.sh -s true diff --git a/api/test/shell/docker_deploy_test.sh b/api/test/shell/manager_smoking.sh similarity index 80% rename from api/test/shell/docker_deploy_test.sh rename to api/test/shell/manager_smoking.sh index 5b0d846..cd76560 100755 --- a/api/test/shell/docker_deploy_test.sh +++ b/api/test/shell/manager_smoking.sh @@ -19,13 +19,42 @@ set -ex -# Version output -verline=$(docker logs docker-deploy_managerapi_1 | grep -E "^Version : [A-Za-z0-9\-\_\.]+") -if [ -z "$verline" ];then - echo "no Version output" - exit 1 +helpFunction() +{ + echo "" + echo "Usage: $0 -s true" + echo -e "\t-s whether skip docker, true or false" + echo -e "\t-h helper info" + exit 1 +} + +while getopts "s:h:" opt +do + case "$opt" in + s ) skip="$OPTARG" ;; + ? ) helpFunction ;; + esac +done + +if [ -z "$skip" ] +then + echo "Some parameters are empty"; + helpFunction; fi +if "$skip" +then + echo "skip docker check" +else + # Version output + verline=$(docker logs docker-deploy_managerapi_1 | grep -E "^Version : [A-Za-z0-9\-\_\.]+") + if [ -z "$verline" ];then + echo "no Version output" + exit 1 + fi +fi + + # web page curl http://127.0.0.1:9000 code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9000)