|
| 1 | +name: TAs Regression Test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - develop |
| 7 | + - main |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - "**" |
| 11 | + workflow_dispatch: |
| 12 | + inputs: |
| 13 | + target_repo: |
| 14 | + description: "Target repository" |
| 15 | + required: false |
| 16 | + default: "" |
| 17 | + target_branch: |
| 18 | + description: "Target branch" |
| 19 | + required: false |
| 20 | + default: "main" |
| 21 | + |
| 22 | +jobs: |
| 23 | + build-ucc: |
| 24 | + runs-on: ubuntu-22.04 |
| 25 | + steps: |
| 26 | + - name: Checkout UCC Framework Repository |
| 27 | + uses: actions/checkout@v4 |
| 28 | + with: |
| 29 | + path: UCC |
| 30 | + |
| 31 | + - name: Set up Python |
| 32 | + uses: actions/setup-python@v5 |
| 33 | + with: |
| 34 | + python-version: "3.7" |
| 35 | + |
| 36 | + - name: Install Poetry |
| 37 | + run: pip install poetry==1.5.1 |
| 38 | + |
| 39 | + - name: Build UCC Framework Package |
| 40 | + working-directory: UCC |
| 41 | + run: | |
| 42 | + poetry install |
| 43 | + poetry build |
| 44 | +
|
| 45 | + - name: Upload UCC Artifact |
| 46 | + uses: actions/upload-artifact@v4 |
| 47 | + with: |
| 48 | + name: ucc-package-whl |
| 49 | + path: UCC/dist/*.whl |
| 50 | + |
| 51 | + test-addons: |
| 52 | + needs: build-ucc |
| 53 | + strategy: |
| 54 | + matrix: |
| 55 | + target_repo: |
| 56 | + - splunk/splunk-add-on-for-amazon-web-services |
| 57 | + - splunk/splunk-add-on-for-google-cloud-platform |
| 58 | + - splunk/splunk-add-on-for-google-workspace |
| 59 | + - splunk/splunk-add-on-for-microsoft-cloud-services |
| 60 | + - splunk/splunk-add-on-for-microsoft-office-365 |
| 61 | + - splunk/splunk-add-on-for-salesforce |
| 62 | + - splunk/splunk-add-on-for-servicenow |
| 63 | + - splunk/splunk-add-on-for-mysql |
| 64 | + continue-on-error: true |
| 65 | + runs-on: ubuntu-22.04 |
| 66 | + steps: |
| 67 | + - name: Checkout Target Add-on Repository |
| 68 | + if: ${{ github.event_name == 'push' || github.event.inputs.target_repo == '' }} |
| 69 | + uses: actions/checkout@v4 |
| 70 | + with: |
| 71 | + repository: ${{ matrix.target_repo }} |
| 72 | + path: TA |
| 73 | + token: ${{ secrets.GH_TOKEN_ADMIN }} |
| 74 | + |
| 75 | + - name: Checkout Target Add-on Repository (manual) |
| 76 | + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target_repo != '' }} |
| 77 | + uses: actions/checkout@v4 |
| 78 | + with: |
| 79 | + repository: ${{ github.event.inputs.target_repo }} |
| 80 | + ref: ${{ github.event.inputs.target_branch }} |
| 81 | + path: TA |
| 82 | + token: ${{ secrets.GH_TOKEN_ADMIN }} |
| 83 | + |
| 84 | + - name: Set up Python |
| 85 | + uses: actions/setup-python@v5 |
| 86 | + with: |
| 87 | + python-version: "3.7" |
| 88 | + |
| 89 | + - name: Install Poetry |
| 90 | + run: pip install poetry==1.5.1 |
| 91 | + |
| 92 | + - name: Download UCC Artifact |
| 93 | + uses: actions/download-artifact@v4 |
| 94 | + with: |
| 95 | + name: ucc-package-whl |
| 96 | + path: UCC |
| 97 | + |
| 98 | + - name: Install Dependencies in Target Add-on |
| 99 | + working-directory: TA |
| 100 | + run: | |
| 101 | + UCC_WHL=$(ls ../UCC/*.whl) |
| 102 | + # https://github.com/python-poetry/poetry/issues/7491#issuecomment-1423763839 |
| 103 | + git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com |
| 104 | + git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://git@github.com |
| 105 | + poetry add ../UCC/$UCC_WHL --group dev |
| 106 | + poetry add splunktaucclib@latest |
| 107 | + mkdir -p package/lib |
| 108 | + poetry export --without-hashes -o package/lib/requirements.txt |
| 109 | +
|
| 110 | + - name: Run ucc-gen build in Target Add-on |
| 111 | + working-directory: TA |
| 112 | + run: | |
| 113 | + poetry run ucc-gen build |
0 commit comments