|
15 | 15 | name: Build e2e tests |
16 | 16 |
|
17 | 17 | on: |
18 | | - push: |
19 | | - branches: [ github-actions-salesforce-automation ] |
20 | | - pull_request: |
21 | | - branches: [ github-actions-salesforce-automation ] |
22 | | - types: [opened, synchronize, reopened, labeled] |
23 | | - workflow_dispatch: |
| 18 | + workflow_run: |
| 19 | + workflows: |
| 20 | + - Trigger build |
| 21 | + types: |
| 22 | + - completed |
24 | 23 |
|
25 | 24 | jobs: |
26 | 25 | build: |
27 | 26 | runs-on: k8s-runner-e2e |
28 | 27 |
|
29 | | - # We allow builds: |
30 | | - # 1) When triggered manually |
31 | | - # 2) When it's a merge into a branch |
32 | | - # 3) For PRs that are labeled as build and |
33 | | - # - It's a code change |
34 | | - # - A build label was just added |
35 | | - # A bit complex, but prevents builds when other labels are manipulated |
36 | | - if: > |
37 | | - github.event_name == 'workflow_dispatch' |
38 | | - || github.event_name == 'push' |
39 | | - || (contains(github.event.pull_request.labels.*.name, 'build') |
40 | | - && (github.event.action != 'labeled' || github.event.label.name == 'build') |
41 | | - ) |
| 28 | + if: ${{ github.event.workflow_run.conclusion != 'skipped' }} |
| 29 | + |
42 | 30 | steps: |
43 | 31 | # Pinned 1.0.0 version |
| 32 | + - uses: haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94 |
44 | 33 | |
45 | 34 | with: |
46 | 35 | path: plugin |
| 36 | + ref: ${{ github.event.workflow_run.head_sha }} |
| 37 | + |
47 | 38 | - name: Checkout e2e test repo |
48 | 39 | |
49 | 40 | with: |
50 | 41 | repository: cdapio/cdap-e2e-tests |
51 | 42 | path: e2e |
| 43 | + |
52 | 44 | - name: Cache |
53 | 45 | |
54 | 46 | with: |
55 | 47 | path: ~/.m2/repository |
56 | 48 | key: ${{ runner.os }}-maven-${{ github.workflow }}-${{ hashFiles('**/pom.xml') }} |
57 | 49 | restore-keys: | |
58 | 50 | ${{ runner.os }}-maven-${{ github.workflow }} |
| 51 | +
|
| 52 | + - name: Get Secrets from GCP Secret Manager |
| 53 | + id: 'secrets' |
| 54 | + uses: 'google-github-actions/get-secretmanager-secrets@v0' |
| 55 | + with: |
| 56 | + secrets: |- |
| 57 | + SALESFORCE_USERNAME:cdapio-github-builds/SALESFORCE_USERNAME |
| 58 | + SALESFORCE_PASSWORD:cdapio-github-builds/SALESFORCE_PASSWORD |
| 59 | + SALESFORCE_SECURITY_TOKEN:cdapio-github-builds/SALESFORCE_SECURITY_TOKEN |
| 60 | + SALESFORCE_CONSUMER_KEY:cdapio-github-builds/SALESFORCE_CONSUMER_KEY |
| 61 | + SALESFORCE_CONSUMER_SECRET:cdapio-github-builds/SALESFORCE_CONSUMER_SECRET |
| 62 | +
|
59 | 63 | - name: Run tests |
60 | 64 | run: python3 e2e/src/main/scripts/run_e2e_test.py |
61 | | - - name: Upload report |
| 65 | + env: |
| 66 | + SALESFORCE_USERNAME: ${{ steps.secrets.outputs.SALESFORCE_USERNAME }} |
| 67 | + SALESFORCE_PASSWORD: ${{ steps.secrets.outputs.SALESFORCE_PASSWORD }} |
| 68 | + SALESFORCE_SECURITY_TOKEN: ${{ steps.secrets.outputs.SALESFORCE_SECURITY_TOKEN }} |
| 69 | + SALESFORCE_CONSUMER_KEY: ${{ steps.secrets.outputs.SALESFORCE_CONSUMER_KEY }} |
| 70 | + SALESFORCE_CONSUMER_SECRET: ${{ steps.secrets.outputs.SALESFORCE_CONSUMER_SECRET }} |
| 71 | + |
| 72 | + - name: Upload report |
62 | 73 | |
63 | 74 | if: always() |
64 | 75 | with: |
65 | 76 | name: Cucumber report |
66 | 77 | path: ./plugin/target/cucumber-reports |
67 | | - - name: Upload debug files |
| 78 | + |
| 79 | + - name: Upload debug files |
68 | 80 | |
69 | 81 | if: always() |
70 | 82 | with: |
71 | 83 | name: Debug files |
72 | 84 | path: ./**/target/e2e-debug |
73 | | - - name: Deploy report |
74 | | - uses: peaceiris/actions-gh-pages@v3 |
| 85 | + |
| 86 | + - name: Upload reports to GCS |
| 87 | + uses: google-github-actions/upload-cloud-storage@v0 |
75 | 88 | if: always() |
76 | 89 | with: |
77 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
78 | | - publish_dir: ./plugin/target/cucumber-reports |
79 | | - destination_dir: cucumber-reports/${{ github.ref }} |
80 | | - |
| 90 | + path: ./plugin/target/cucumber-reports |
| 91 | + destination: e2e-tests-cucumber-reports/${{ github.event.repository.name }}/${{ github.ref }} |
| 92 | + |
81 | 93 | - name: github-status-action |
82 | 94 | uses: Sibz/github-status-action@67af1f4042a5a790681aad83c44008ca6cfab83d |
83 | 95 | if: always() |
84 | 96 | with: |
85 | 97 | authToken: ${{ secrets.GITHUB_TOKEN }} |
86 | 98 | state: success |
87 | 99 | context: Cucumber report |
88 | | - target_url: https://data-integrations.github.io/salesforce/cucumber-reports/${{ github.ref }}/advanced-reports/cucumber-html-reports/overview-features.html |
89 | 100 | sha: ${{github.event.pull_request.head.sha || github.sha}} |
| 101 | + |
0 commit comments