|
| 1 | +# Copyright © 2022 Cask Data, Inc. |
| 2 | +# Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 3 | +# use this file except in compliance with the License. You may obtain a copy of |
| 4 | +# the License at |
| 5 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | +# Unless required by applicable law or agreed to in writing, software |
| 7 | +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 8 | +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 9 | +# License for the specific language governing permissions and limitations under |
| 10 | +# the License. |
| 11 | + |
| 12 | +# This workflow will build a Java project with Maven |
| 13 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven |
| 14 | +# Note: Any changes to this workflow would be used only after merging into develop |
| 15 | +name: Build e2e tests |
| 16 | + |
| 17 | +on: |
| 18 | + workflow_run: |
| 19 | + workflows: |
| 20 | + - Trigger build |
| 21 | + types: |
| 22 | + - completed |
| 23 | + |
| 24 | +jobs: |
| 25 | + build: |
| 26 | + runs-on: k8s-runner-e2e |
| 27 | + |
| 28 | + steps: |
| 29 | + - uses: haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94 |
| 30 | + - uses: actions/checkout@v2.3.4 |
| 31 | + with: |
| 32 | + repository: data-integrations/google-cloud |
| 33 | + path: plugin |
| 34 | + |
| 35 | + - name: Checkout e2e test repo |
| 36 | + uses: actions/checkout@v2.3.4 |
| 37 | + with: |
| 38 | + repository: cdapio/cdap-e2e-tests |
| 39 | + path: e2e |
| 40 | + |
| 41 | + - name: Cache |
| 42 | + uses: actions/cache@v2.1.3 |
| 43 | + with: |
| 44 | + path: ~/.m2/repository |
| 45 | + key: ${{ runner.os }}-maven-${{ github.workflow }}-${{ hashFiles('**/pom.xml') }} |
| 46 | + restore-keys: | |
| 47 | + ${{ runner.os }}-maven-${{ github.workflow }} |
| 48 | +
|
| 49 | + - name: Get Secrets from GCP Secret Manager |
| 50 | + id: 'secrets' |
| 51 | + uses: 'google-github-actions/get-secretmanager-secrets@v0' |
| 52 | + with: |
| 53 | + secrets: |- |
| 54 | + SERVICE_NOW_CLIENT_ID:cdapio-github-builds/SERVICE_NOW_CLIENT_ID |
| 55 | + SERVICE_NOW_CLIENT_SECRET:cdapio-github-builds/SERVICE_NOW_CLIENT_SECRET |
| 56 | + SERVICE_NOW_REST_API_ENDPOINT:cdapio-github-builds/SERVICE_NOW_REST_API_ENDPOINT |
| 57 | + SERVICE_NOW_USERNAME:cdapio-github-builds/SERVICE_NOW_USERNAME |
| 58 | + SERVICE_NOW_PASSWORD:cdapio-github-builds/SERVICE_NOW_PASSWORD |
| 59 | +
|
| 60 | + - name: Run tests |
| 61 | + run: python3 e2e/src/main/scripts/run_e2e_test.py |
| 62 | + env: |
| 63 | + SERVICE_NOW_CLIENT_ID: ${{ steps.secrets.outputs.SERVICE_NOW_CLIENT_ID }} |
| 64 | + SERVICE_NOW_CLIENT_SECRET: ${{ steps.secrets.outputs.SERVICE_NOW_CLIENT_SECRET }} |
| 65 | + SERVICE_NOW_REST_API_ENDPOINT: ${{ steps.secrets.outputs.SERVICE_NOW_REST_API_ENDPOINT }} |
| 66 | + SERVICE_NOW_USERNAME: ${{ steps.secrets.outputs.SERVICE_NOW_USERNAME }} |
| 67 | + SERVICE_NOW_PASSWORD: ${{ steps.secrets.outputs.SERVICE_NOW_PASSWORD }} |
| 68 | + |
| 69 | + - name: Upload report |
| 70 | + uses: actions/upload-artifact@v2.2.4 |
| 71 | + if: always() |
| 72 | + with: |
| 73 | + name: Cucumber report |
| 74 | + path: ./plugin/target/cucumber-reports |
| 75 | + |
| 76 | + - name: Upload debug files |
| 77 | + uses: actions/upload-artifact@v2.2.4 |
| 78 | + if: always() |
| 79 | + with: |
| 80 | + name: Debug files |
| 81 | + path: ./**/target/e2e-debug |
| 82 | + |
| 83 | + - name: Deploy report |
| 84 | + uses: peaceiris/actions-gh-pages@v3 |
| 85 | + if: always() |
| 86 | + with: |
| 87 | + github_token: ${{ secrets.AUTH_TOKEN }} |
| 88 | + publish_dir: ./plugin/target/cucumber-reports |
| 89 | + destination_dir: cucumber-reports/${{ github.ref }} |
| 90 | + |
| 91 | + - name: github-status-action |
| 92 | + uses: Sibz/github-status-action@67af1f4042a5a790681aad83c44008ca6cfab83d |
| 93 | + if: always() |
| 94 | + with: |
| 95 | + authToken: ${{ secrets.AUTH_TOKEN }} |
| 96 | + state: success |
| 97 | + context: Cucumber report |
| 98 | + target_url: https://data-integrations.github.io/servicenow-plugins/cucumber-reports/${{ github.ref }}/advanced-reports/cucumber-html-reports/overview-features.html |
| 99 | + sha: ${{github.event.pull_request.head.sha || github.sha}} |
0 commit comments