| name: Release Test |
| |
| on: |
| push: |
| branches: |
| - master |
| paths-ignore: |
| - 'docs/**' |
| pull_request: |
| branches: |
| - master |
| paths-ignore: |
| - 'docs/**' |
| |
| jobs: |
| run-test: |
| runs-on: ubuntu-latest |
| |
| services: |
| etcd: |
| image: bitnami/etcd:3.4.13 |
| ports: |
| - 2379:2379 |
| - 2380:2380 |
| env: |
| ALLOW_NONE_AUTHENTICATION: yes |
| |
| steps: |
| - uses: actions/checkout@v2 |
| |
| - name: setup go |
| uses: actions/setup-go@v2.1.3 |
| with: |
| go-version: '1.13' |
| |
| - name: release and build |
| run: | |
| VERSION=$(cat ./api/VERSION) |
| mkdir release |
| git clean -Xdf |
| tar -zcvf release/apache-apisix-dashboard-${VERSION}-src.tgz \ |
| --exclude .github \ |
| --exclude .git \ |
| --exclude .gitattributes \ |
| --exclude .idea \ |
| --exclude .vscode \ |
| --exclude .gitignore \ |
| --exclude .DS_Store \ |
| --exclude docs \ |
| --exclude release \ |
| --exclude api/internal/core/store/validate_mock.go \ |
| --exclude api/internal/core/storage/storage_mock.go \ |
| . |
| |
| cd release |
| tar -zxvf apache-apisix-dashboard-${VERSION}-src.tgz |
| ls -l |
| export GO111MOUDULE=on |
| api/build.sh |
| mkdir -p ./output/logs |
| cd output |
| ./manager-api > ./api.log 2>&1 & |
| sleep 3 |
| cat ./api.log |
| cat ./logs/error.log |
| cat conf/conf.yaml |
| |
| - name: run test |
| run: | |
| curl http://127.0.0.1:9000/apisix/admin/user/login -X POST -i -d '{"username":"admin", "password": "admin"}' |
| code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9000/apisix/admin/user/login -X POST -i -d '{"username":"admin", "password": "admin"}') |
| if [ ! $code -eq 200 ]; then |
| echo "failed: failed to custom port" |
| exit 1 |
| fi |