blob: 3b122bed782d1c2b2b4ff234952a060738e03725 [file] [log] [blame]
raviteja.karumuri173f2c62024-10-09 12:32:04 +01001name: oran-functional-test-case-verify
2
3on:
4 workflow_dispatch:
5 # For Branch-Protection check. Only the default branch is supported. See
6 # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
7 inputs:
8 GERRIT_BRANCH:
9 description: 'Branch that change is against'
10 required: true
11 type: string
12 GERRIT_CHANGE_ID:
13 description: 'The ID for the change'
14 required: true
15 type: string
16 GERRIT_CHANGE_NUMBER:
17 description: 'The Gerrit number'
18 required: true
19 type: string
20 GERRIT_CHANGE_URL:
21 description: 'URL to the change'
22 required: true
23 type: string
24 GERRIT_EVENT_TYPE:
25 description: 'Gerrit event type'
26 required: true
27 type: string
28 GERRIT_PATCHSET_NUMBER:
29 description: 'The patch number for the change'
30 required: true
31 type: string
32 GERRIT_PATCHSET_REVISION:
33 description: 'The revision sha'
34 required: true
35 type: string
36 GERRIT_PROJECT:
37 description: 'Project in Gerrit'
38 required: true
39 type: string
40 GERRIT_REFSPEC:
41 description: 'Gerrit refspec of change'
42 required: true
43 type: string
44
45concurrency:
46 group: ${{ github.event.inputs.GERRIT_CHANGE_ID || github.run_id }}
47 cancel-in-progress: true
48
49jobs:
raviteja.karumuric2771412024-10-14 16:29:34 +010050 notify:
51 runs-on: ubuntu-latest
52 steps:
53 - name: Notify job start
54 # yamllint disable-line rule:line-length
raviteja.karumuri651a7e22024-10-15 16:34:23 +010055 uses: lfit/gerrit-review-action@v0.8
raviteja.karumuric2771412024-10-14 16:29:34 +010056 with:
57 host: ${{ vars.GERRIT_SERVER }}
58 username: ${{ vars.GERRIT_SSH_USER }}
59 key: ${{ secrets.GERRIT_SSH_PRIVKEY }}
60 known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }}
61 gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
62 gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
63 comment-only: true
64 - name: Allow replication
65 run: sleep 10s
raviteja.karumuri173f2c62024-10-09 12:32:04 +010066 ftc-run:
raviteja.karumuric2771412024-10-14 16:29:34 +010067 needs: notify
68 runs-on: ubuntu-latest
raviteja.karumuri173f2c62024-10-09 12:32:04 +010069 steps:
70 # Step 1: Checkout the repository to build
71 - name: Checkout ccsdk-oran Maven Project Repository
raviteja.karumuri651a7e22024-10-15 16:34:23 +010072 uses: lfit/checkout-gerrit-change-action@v0.9
raviteja.karumuri173f2c62024-10-09 12:32:04 +010073 with:
74 gerrit-refspec: ${{ inputs.GERRIT_REFSPEC }}
75 gerrit-url: ${{ inputs.GERRIT_CHANGE_URL }}
76 gerrit-project: ${{ inputs.GERRIT_PROJECT }}
77 ref: ${{ inputs.GERRIT_BRANCH }}
raviteja.karumuri173f2c62024-10-09 12:32:04 +010078 # Step 2: Set up JDK for Maven
79 - name: Set up JDK 17
80 uses: actions/setup-java@v3
81 with:
82 java-version: '17'
83 distribution: 'temurin' # Or 'zulu' or 'adopt'
raviteja.karumuri173f2c62024-10-09 12:32:04 +010084 # Step 3: Run Maven build
85 - name: Build a1-policy-management image with Maven
86 run: |
87 cd a1-policy-management
raviteja.karumuri651a7e22024-10-15 16:34:23 +010088 mvn clean install -Dmaven.test.skip=true
raviteja.karumuri173f2c62024-10-09 12:32:04 +010089 # Step 4: Run FTC on new a1-policy review
90 - name: Run FTC tests with the local a1-policy image
91 run: |
92 git clone https://gerrit.o-ran-sc.org/r/nonrtric
93 cd nonrtric/test/auto-test
94 chmod +x ./onap-verify-jobs.sh
raviteja.karumuric2771412024-10-14 16:29:34 +010095 sudo bash ./onap-verify-jobs.sh
raviteja.karumuri651a7e22024-10-15 16:34:23 +010096 # Step 5: uploading the logs
97 - name: uploading the logs
98 uses: actions/upload-artifact@v4
99 with:
100 name: FTC-Logs
101 retention-days: 3
102 path: nonrtric/test/auto-test/logs
raviteja.karumuric2771412024-10-14 16:29:34 +0100103 report-status:
104 if: ${{ always() }}
105 needs: [ notify, ftc-run ]
106 runs-on: ubuntu-latest
107 steps:
108 - name: Get workflow conclusion
109 uses: technote-space/workflow-conclusion-action@v3
110 - name: Report workflow conclusion
111 # yamllint disable-line rule:line-length
raviteja.karumuri651a7e22024-10-15 16:34:23 +0100112 uses: lfit/gerrit-review-action@v0.8
raviteja.karumuric2771412024-10-14 16:29:34 +0100113 with:
114 host: ${{ vars.GERRIT_SERVER }}
115 username: ${{ vars.GERRIT_SSH_USER }}
116 key: ${{ secrets.GERRIT_SSH_PRIVKEY }}
117 known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }}
118 gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
119 gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
120 vote-type: ${{ env.WORKFLOW_CONCLUSION }}
121 comment-only: true