diff --git a/.github/workflows/full-e2e-test.yml b/.github/workflows/full-e2e-test.yml deleted file mode 100644 index 97fca6f1..00000000 --- a/.github/workflows/full-e2e-test.yml +++ /dev/null @@ -1,204 +0,0 @@ -name: full-front-e2e-test -on: - push: - branches: - - 'release*' - - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - - -jobs: - - Pre: - name: Prepare - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Clean - uses: appleboy/ssh-action@master - with: - host: ${{ secrets.CHJ_REMOTE_HOST }} - username: root - key: ${{ secrets.CHJ_REMOTE_KEY }} - port: ${{ secrets.CHJ_REMOTE_PORT }} - script: | - rm -rf /root/console - rm -rf /root/console-others - rm -rf /root/console-online - - - name: Copy - uses: appleboy/scp-action@master - env: - HOST: ${{ secrets.CHJ_REMOTE_HOST }} - USERNAME: root - PORT: ${{ secrets.CHJ_REMOTE_PORT }} - KEY: ${{ secrets.CHJ_REMOTE_KEY }} - with: - source: "/home/runner/work/console/console" - target: "/root/console" - - Deploy: - name: Deploy - runs-on: ubuntu-latest - - steps: - - - name: Deploy - uses: appleboy/ssh-action@master - with: - command_timeout: 60m - host: ${{ secrets.CHJ_REMOTE_HOST }} - username: root - key: ${{ secrets.CHJ_REMOTE_KEY }} - port: ${{ secrets.CHJ_REMOTE_PORT }} - script: | - set -e - sh /root/deploy-release-1.3.sh - - - name: install dependence - uses: appleboy/ssh-action@master - with: - command_timeout: 60m - host: ${{ secrets.CHJ_REMOTE_HOST }} - username: root - key: ${{ secrets.CHJ_REMOTE_KEY }} - port: ${{ secrets.CHJ_REMOTE_PORT }} - script: | - set -e - pushd /root/console/github/workspace - yarn config set registry https://registry.npm.taobao.org/ - yarn install - - - cluster: - name: e2e cluster - runs-on: ubuntu-latest - needs: Deploy - - steps: - - - name: Get branch name - id: extract_branch - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - - - name: Run e2e cluster - uses: appleboy/ssh-action@master - with: - command_timeout: 120m - host: ${{ secrets.CHJ_REMOTE_HOST }} - username: root - key: ${{ secrets.CHJ_REMOTE_KEY }} - port: ${{ secrets.CHJ_REMOTE_PORT }} - script: | - set -e - pushd /root/console/github/workspace - cp cypress/config/config-cluster.yaml cypress/config/local_config.yaml - sed -i "s/localhost/${{ secrets.CHJ_GITHUB_BACK1 }}/" cypress/config/config.yaml - sh tools/e2e-smoke.sh - ssh root@${{ secrets.CHJ_DOCS }} "mkdir -pv /var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}"/cluster/ - scp testcases-cases.html root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/cluster/ - scp testcases-e2e-summary.html root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/cluster/ - scp cypress/report/merge-report.html root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/cluster/ - scp cypress/report/merge-report.json root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/cluster/ - ssh root@${{ secrets.CHJ_DOCS }} "rm -rf /var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/cluster/assets" - scp -r cypress/report/assets root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/cluster/ - if [ -d "cypress/screenshots" ];then - ssh root@${{ secrets.CHJ_DOCS }} "rm -rf /var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/cluster/screenshots" - scp -r cypress/screenshots root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/cluster/ - echo e2e-test-cluster fail - exit 110 - else - echo e2e-test-cluster successfully - fi - - online: - name: e2e online - runs-on: ubuntu-latest - needs: cluster - - steps: - - - name: Get branch name - id: extract_branch - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - - - name: Run e2e online - uses: appleboy/ssh-action@master - with: - command_timeout: 120m - host: ${{ secrets.CHJ_REMOTE_HOST }} - username: root - key: ${{ secrets.CHJ_REMOTE_KEY }} - port: ${{ secrets.CHJ_REMOTE_PORT }} - script: | - set -e - cp -r /root/console /root/console-online - pushd /root/console-online/github/workspace - cp cypress/config/config-online.yaml cypress/config/local_config.yaml - sed -i "s/localhost/${{ secrets.CHJ_GITHUB_BACK1 }}/" cypress/config/config.yaml - sh tools/e2e-smoke.sh - ssh root@${{ secrets.CHJ_DOCS }} "mkdir -pv /var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}"/online/ - scp testcases-cases.html root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/online/ - scp testcases-e2e-summary.html root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/online/ - scp cypress/report/merge-report.html root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/online/ - scp cypress/report/merge-report.json root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/online/ - ssh root@${{ secrets.CHJ_DOCS }} "rm -rf /var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/online/assets" - scp -r cypress/report/assets root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/online/ - if [ -d "cypress/screenshots" ];then - ssh root@${{ secrets.CHJ_DOCS }} "rm -rf /var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/online/screenshots" - scp -r cypress/screenshots root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/online/ - echo e2e-test-online fail - exit 110 - else - echo e2e-test-online successfully - fi - - others: - name: e2e others - runs-on: ubuntu-latest - needs: Deploy - - steps: - - - name: Get branch name - id: extract_branch - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - - - name: Run e2e others - uses: appleboy/ssh-action@master - with: - command_timeout: 120m - host: ${{ secrets.CHJ_REMOTE_HOST }} - username: root - key: ${{ secrets.CHJ_REMOTE_KEY }} - port: ${{ secrets.CHJ_REMOTE_PORT }} - script: | - set -e - cp -r /root/console /root/console-others - pushd /root/console-others/github/workspace - cp cypress/config/config-others.yaml cypress/config/local_config.yaml - sed -i "s/localhost/${{ secrets.CHJ_GITHUB_BACK1 }}/" cypress/config/config.yaml - sh tools/e2e-smoke.sh - ssh root@${{ secrets.CHJ_DOCS }} "mkdir -pv /var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}"/others/ - scp testcases-cases.html root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/others/ - scp testcases-e2e-summary.html root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/others/ - scp cypress/report/merge-report.html root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/others/ - scp cypress/report/merge-report.json root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/others/ - ssh root@${{ secrets.CHJ_DOCS }} "rm -rf /var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/others/assets" - scp -r cypress/report/assets root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/others/ - if [ -d "cypress/screenshots" ];then - ssh root@${{ secrets.CHJ_DOCS }} "rm -rf /var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/others/screenshots" - scp -r cypress/screenshots root@${{ secrets.CHJ_DOCS }}:/var/www/html/caas-test-case/github/${{ steps.extract_branch.outputs.branch }}/others/ - echo e2e-test-others fail - exit 110 - else - echo e2e-test-others successfully - fi \ No newline at end of file