raviteja.karumuri | 173f2c6 | 2024-10-09 12:32:04 +0100 | [diff] [blame] | 1 | name: oran-functional-test-case-verify |
| 2 | |
| 3 | on: |
| 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 | |
| 45 | concurrency: |
| 46 | group: ${{ github.event.inputs.GERRIT_CHANGE_ID || github.run_id }} |
| 47 | cancel-in-progress: true |
| 48 | |
| 49 | jobs: |
raviteja.karumuri | c277141 | 2024-10-14 16:29:34 +0100 | [diff] [blame] | 50 | notify: |
| 51 | runs-on: ubuntu-latest |
| 52 | steps: |
| 53 | - name: Notify job start |
| 54 | # yamllint disable-line rule:line-length |
raviteja.karumuri | 651a7e2 | 2024-10-15 16:34:23 +0100 | [diff] [blame^] | 55 | uses: lfit/gerrit-review-action@v0.8 |
raviteja.karumuri | c277141 | 2024-10-14 16:29:34 +0100 | [diff] [blame] | 56 | 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.karumuri | 173f2c6 | 2024-10-09 12:32:04 +0100 | [diff] [blame] | 66 | ftc-run: |
raviteja.karumuri | c277141 | 2024-10-14 16:29:34 +0100 | [diff] [blame] | 67 | needs: notify |
| 68 | runs-on: ubuntu-latest |
raviteja.karumuri | 173f2c6 | 2024-10-09 12:32:04 +0100 | [diff] [blame] | 69 | steps: |
| 70 | # Step 1: Checkout the repository to build |
| 71 | - name: Checkout ccsdk-oran Maven Project Repository |
raviteja.karumuri | 651a7e2 | 2024-10-15 16:34:23 +0100 | [diff] [blame^] | 72 | uses: lfit/checkout-gerrit-change-action@v0.9 |
raviteja.karumuri | 173f2c6 | 2024-10-09 12:32:04 +0100 | [diff] [blame] | 73 | 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.karumuri | 173f2c6 | 2024-10-09 12:32:04 +0100 | [diff] [blame] | 78 | # 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.karumuri | 173f2c6 | 2024-10-09 12:32:04 +0100 | [diff] [blame] | 84 | # Step 3: Run Maven build |
| 85 | - name: Build a1-policy-management image with Maven |
| 86 | run: | |
| 87 | cd a1-policy-management |
raviteja.karumuri | 651a7e2 | 2024-10-15 16:34:23 +0100 | [diff] [blame^] | 88 | mvn clean install -Dmaven.test.skip=true |
raviteja.karumuri | 173f2c6 | 2024-10-09 12:32:04 +0100 | [diff] [blame] | 89 | # 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.karumuri | c277141 | 2024-10-14 16:29:34 +0100 | [diff] [blame] | 95 | sudo bash ./onap-verify-jobs.sh |
raviteja.karumuri | 651a7e2 | 2024-10-15 16:34:23 +0100 | [diff] [blame^] | 96 | # 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.karumuri | c277141 | 2024-10-14 16:29:34 +0100 | [diff] [blame] | 103 | 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.karumuri | 651a7e2 | 2024-10-15 16:34:23 +0100 | [diff] [blame^] | 112 | uses: lfit/gerrit-review-action@v0.8 |
raviteja.karumuri | c277141 | 2024-10-14 16:29:34 +0100 | [diff] [blame] | 113 | 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 |