ci_e2e.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. on: ["pull_request"]
  18. env:
  19. DOCKER_DIR: ./docker
  20. LOG_DIR: /tmp/dolphinscheduler
  21. name: e2e Test
  22. jobs:
  23. build:
  24. name: Test
  25. runs-on: ubuntu-latest
  26. steps:
  27. - uses: actions/checkout@v2
  28. # In the checkout@v2, it doesn't support git submodule. Execute the commands manually.
  29. - name: checkout submodules
  30. shell: bash
  31. run: |
  32. git submodule sync --recursive
  33. git -c protocol.version=2 submodule update --init --force --recursive --depth=1
  34. - uses: actions/cache@v1
  35. with:
  36. path: ~/.m2/repository
  37. key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
  38. restore-keys: |
  39. ${{ runner.os }}-maven-
  40. - name: Build Image
  41. run: |
  42. export VERSION=`cat $(pwd)/pom.xml| grep "SNAPSHOT</version>" | awk -F "-SNAPSHOT" '{print $1}' | awk -F ">" '{print $2}'`
  43. sh ./dockerfile/hooks/build
  44. - name: Docker Run
  45. run: |
  46. VERSION=`cat $(pwd)/pom.xml| grep "SNAPSHOT</version>" | awk -F "-SNAPSHOT" '{print $1}' | awk -F ">" '{print $2}'`
  47. mkdir -p /tmp/logs
  48. docker run -dit -e POSTGRESQL_USERNAME=test -e POSTGRESQL_PASSWORD=test -v /tmp/logs:/opt/dolphinscheduler/logs -p 8888:8888 dolphinscheduler:$VERSION all
  49. - name: Check Server Status
  50. run: sh ./dockerfile/hooks/check
  51. - name: Prepare e2e env
  52. run: |
  53. sudo apt-get install -y libxss1 libappindicator1 libindicator7 xvfb unzip libgbm1
  54. wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
  55. sudo dpkg -i google-chrome*.deb
  56. sudo apt-get install -f -y
  57. wget -N https://chromedriver.storage.googleapis.com/80.0.3987.106/chromedriver_linux64.zip
  58. unzip chromedriver_linux64.zip
  59. sudo mv -f chromedriver /usr/local/share/chromedriver
  60. sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
  61. - name: Run e2e Test
  62. run: cd ./e2e && mvn -B clean test
  63. - name: Collect logs
  64. if: failure()
  65. uses: actions/upload-artifact@v1
  66. with:
  67. name: dslogs
  68. path: /tmp/logs