apisix-docker-test.yaml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. name: APISIX Docker Test
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. branches:
  8. - master
  9. jobs:
  10. build:
  11. strategy:
  12. fail-fast: false
  13. matrix:
  14. platform:
  15. - alpine
  16. - centos
  17. - debian-dev
  18. runs-on: ubuntu-latest
  19. env:
  20. APISIX_DOCKER_TAG: 2.13.2-${{ matrix.platform }}
  21. steps:
  22. - uses: actions/checkout@v2
  23. - name: Build and run
  24. run: |
  25. make build-on-${{ matrix.platform }}
  26. docker-compose -f ./compose/docker-compose.yaml up -d
  27. sleep 30
  28. docker logs compose_apisix_1
  29. - name: Test
  30. run: |
  31. grep -C 3 '\[error\]' example/apisix_log/error.log && exit 1
  32. curl http://127.0.0.1:9080/apisix/admin/routes/1 \
  33. -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
  34. {
  35. "uri": "/get",
  36. "upstream": {
  37. "type": "roundrobin",
  38. "nodes": {
  39. "httpbin.org:80": 1
  40. }
  41. }
  42. }'
  43. result_code=`curl -I -m 10 -o /dev/null -s -w %{http_code} http://127.0.0.1:9080/get`
  44. if [[ $result_code -ne 200 ]];then
  45. printf "result_code: %s\n" "$result_code"
  46. exit 125
  47. fi
  48. - name: Tar Image
  49. if: ${{ !endsWith(matrix.platform, '-local') && !endsWith(matrix.platform, '-dev') }}
  50. run: |
  51. make save-${{ matrix.platform }}-tar
  52. - name: Upload Image
  53. if: ${{ !endsWith(matrix.platform, '-local') && !endsWith(matrix.platform, '-dev') }}
  54. uses: actions/upload-artifact@v2
  55. with:
  56. path: ./package