summaryrefslogtreecommitdiffstats
path: root/.github/workflows/cloud_regression.yml
blob: 67a55ed2a7dd399c88be4ba2ec0db10ed44e1854 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Trigger Cloud Regression E2E Tests
on:
  push:
    branches: [master]
    paths:
      - 'CMakeLists.txt'
      - '**.c'
      - '**.cc'
      - '**.cpp'
      - '**.h'
      - 'mqtt_websockets/**'
      - 'aclk/aclk-schemas/**'
jobs:
  trigger_cloud_regression_tests:
    runs-on: ubuntu-latest
    if: github.repository == 'netdata/netdata'
    steps:
      - name: Evaluate workflow dispatch parameters
        env:
          PR_REPO_NAME: ${{ github.event.pull_request.head.repo.full_name }}
          PR_BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
          PR_COMMIT_HASH: ${{ github.event.pull_request.head.sha }}
        id: output-workflow-dispatch-params
        run: |
          if [ "${{ github.event_name }}" == 'pull_request_target' ]; then
            NETDATA_CUSTOM_REPO="$PR_REPO_NAME"
            NETDATA_CUSTOM_BRANCH="$PR_BRANCH_NAME"
            NETDATA_CUSTOM_PR_NUMBER="${{ github.event.number }}"
            NETDATA_CUSTOM_COMMIT_HASH="$PR_COMMIT_HASH"
          elif [ "${{ github.event_name }}" == 'push' ]; then
            NETDATA_CUSTOM_REPO="netdata/netdata"
            NETDATA_CUSTOM_BRANCH="master"
            NETDATA_CUSTOM_PR_NUMBER=""
            NETDATA_CUSTOM_COMMIT_HASH="${{ github.sha }}"
          fi

          {
            echo "netdata_repo=${NETDATA_CUSTOM_REPO}"
            echo "netdata_branch=${NETDATA_CUSTOM_BRANCH}"
            echo "netdata_pr_number=${NETDATA_CUSTOM_PR_NUMBER}"
            echo "netdata_commit_hash=${NETDATA_CUSTOM_COMMIT_HASH}"
          } >> "$GITHUB_OUTPUT"

      - name: Trigger Full Cloud Regression
        uses: aurelien-baudet/workflow-dispatch@v2
        with:
          repo: netdata/test-automation
          ref: refs/heads/master
          workflow: regression.yml
          token: ${{ secrets.NETDATABOT_GITHUB_TOKEN  }}
          inputs: '{ "netdata_branch": "${{ steps.output-workflow-dispatch-params.outputs.netdata_branch }}",
               "netdata_repo": "${{ steps.output-workflow-dispatch-params.outputs.netdata_repo }}",
               "netdata_pr_number": "${{ steps.output-workflow-dispatch-params.outputs.netdata_pr_number }}",
               "netdata_branch_commit_hash": "${{ steps.output-workflow-dispatch-params.outputs.netdata_commit_hash }}",
               "custom_netdata_image": "true"
               }'
          wait-for-completion: false

      - name: Trigger Agent Parent/Child with Cloud Integration tests
        uses: aurelien-baudet/workflow-dispatch@v2
        with:
          repo: netdata/test-automation
          ref: refs/heads/master
          workflow: agent_smoke_tests.yml
          token: ${{ secrets.NETDATABOT_GITHUB_TOKEN  }}
          inputs: '{ "netdata_branch": "${{ steps.output-workflow-dispatch-params.outputs.netdata_branch }}",
               "netdata_repo": "${{ steps.output-workflow-dispatch-params.outputs.netdata_repo }}",
               "netdata_pr_number": "${{ steps.output-workflow-dispatch-params.outputs.netdata_pr_number }}",
               "netdata_branch_commit_hash": "${{ steps.output-workflow-dispatch-params.outputs.netdata_commit_hash }}",
               "custom_netdata_image": "true"
               }'
          wait-for-completion: true