[Bug]: azure dependency validation for provider family does not allow for major revision only needed for community (free) use #1033
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: 2024 The Crossplane Authors <https://crossplane.io> | |
| # | |
| # SPDX-License-Identifier: CC0-1.0 | |
| name: End to End Testing | |
| on: | |
| issue_comment: | |
| types: [created] | |
| jobs: | |
| check-permissions: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| permission: ${{ steps.check-permissions.outputs.permission }} | |
| steps: | |
| - name: Get Commenter Permissions | |
| id: check-permissions | |
| run: | | |
| echo "Trigger keyword: '/test-examples'" | |
| REPO=${{ github.repository }} | |
| COMMENTER=${{ github.event.comment.user.login }} | |
| # Fetch the commenter's repo-level permission grant | |
| GRANTED=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
| -H "Accept: application/vnd.github.v3+json" \ | |
| "https://api.github.com/repos/$REPO/collaborators/$COMMENTER/permission" | jq -r .permission) | |
| # Make it accessible in the workflow via a job output -- cannot use env | |
| echo "User $COMMENTER has $GRANTED permissions" | |
| echo "permission=$GRANTED" >> "$GITHUB_OUTPUT" | |
| get-example-list: | |
| needs: check-permissions | |
| if: ${{ (needs.check-permissions.outputs.permission == 'admin' || needs.check-permissions.outputs.permission == 'write') && github.event.issue.pull_request != null && contains(github.event.comment.body, '/test-examples')}} | |
| runs-on: ubuntu-latest | |
| outputs: | |
| example_list: ${{ steps.get-example-list-name.outputs.example-list }} | |
| example_hash: ${{ steps.get-example-list-name.outputs.example-hash }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: true | |
| - name: Checkout PR | |
| id: checkout-pr | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh pr checkout ${{ github.event.issue.number }} | |
| git submodule update --init --recursive | |
| OUTPUT=$(git log -1 --format='%H') | |
| echo "commit-sha=$OUTPUT" >> $GITHUB_OUTPUT | |
| - name: Prepare The Example List | |
| env: | |
| COMMENT: ${{ github.event.comment.body }} | |
| id: get-example-list-name | |
| run: | | |
| PATHS=$(echo $COMMENT | sed 's/^.*\/test-examples="//g' | cut -d '"' -f 1 | sed 's/,/ /g') | |
| EXAMPLE_LIST="" | |
| for P in $PATHS; do EXAMPLE_LIST="${EXAMPLE_LIST},$(find $P -name '*.yaml' | tr '\n' ',')"; done | |
| sudo apt-get -y install coreutils | |
| COUNT=$(echo ${EXAMPLE_LIST:1} | grep -o ".yaml" | wc -l) | |
| if [ $COUNT -gt 1 ]; then EXAMPLE_HASH=$(echo ${EXAMPLE_LIST} | md5sum | cut -f1 -d" "); else EXAMPLE_HASH=$(echo ${EXAMPLE_LIST:1} | sed 's/.$//'); fi | |
| echo "Examples: ${EXAMPLE_LIST:1}" | |
| echo "Example Hash: ${EXAMPLE_HASH}" | |
| echo "example-list=${EXAMPLE_LIST:1}" >> $GITHUB_OUTPUT | |
| echo "example-hash=${EXAMPLE_HASH}" >> $GITHUB_OUTPUT | |
| - name: Create Pending Status Check | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh api \ | |
| --method POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| /repos/${{ github.repository }}/statuses/${{ steps.checkout-pr.outputs.commit-sha }} \ | |
| -f state='pending' \ | |
| -f target_url='https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' \ | |
| -f description='Running...' \ | |
| -f context="Uptest-${{ steps.get-example-list-name.outputs.example-hash }}" | |
| uptest: | |
| needs: | |
| - check-permissions | |
| - get-example-list | |
| if: ${{ (needs.check-permissions.outputs.permission == 'admin' || needs.check-permissions.outputs.permission == 'write') && github.event.issue.pull_request != null && contains(github.event.comment.body, '/test-examples')}} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Cleanup Disk | |
| uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 | |
| with: | |
| large-packages: false | |
| swap-storage: false | |
| - name: Setup QEMU | |
| uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0 | |
| with: | |
| platforms: all | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: true | |
| - name: Checkout PR | |
| id: checkout-pr | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh pr checkout ${{ github.event.issue.number }} | |
| git submodule update --init --recursive | |
| OUTPUT=$(git log -1 --format='%H') | |
| echo "commit-sha=$OUTPUT" >> $GITHUB_OUTPUT | |
| - name: Setup Go | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Vendor Dependencies | |
| run: make vendor vendor.check | |
| - name: Run Uptest | |
| id: run-uptest | |
| env: | |
| UPTEST_CLOUD_CREDENTIALS: ${{ secrets.UPTEST_CLOUD_CREDENTIALS }} | |
| UPTEST_EXAMPLE_LIST: ${{ needs.get-example-list.outputs.example_list }} | |
| UPTEST_TEST_DIR: ./_output/controlplane-dump | |
| UPTEST_DATASOURCE_PATH: .work/uptest-datasource.yaml | |
| UPTEST_UPDATE_PARAMETER: "" | |
| run: | | |
| mkdir -p .work && echo "${{ secrets.UPTEST_DATASOURCE }}" > .work/uptest-datasource.yaml | |
| make e2e | |
| - name: Create Successful Status Check | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| EXAMPLE_HASH: ${{ needs.get-example-list.outputs.example_hash }} | |
| run: | | |
| gh api \ | |
| --method POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| /repos/${{ github.repository }}/statuses/${{ steps.checkout-pr.outputs.commit-sha }} \ | |
| -f state='success' \ | |
| -f target_url='https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' \ | |
| -f description='Passed' \ | |
| -f context="Uptest-${EXAMPLE_HASH}" | |
| - name: Collect Cluster Dump | |
| if: always() | |
| run: | | |
| make controlplane.dump | |
| - name: Upload Cluster Dump | |
| if: always() | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: controlplane-dump | |
| path: ./_output/controlplane-dump | |
| - name: Cleanup | |
| if: always() | |
| run: | | |
| eval $(make --no-print-directory build.vars) | |
| ${KUBECTL} delete managed --all || true | |
| - name: Create Unsuccessful Status Check | |
| if: failure() | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| EXAMPLE_HASH: ${{ needs.get-example-list.outputs.example_hash }} | |
| run: | | |
| gh api \ | |
| --method POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| /repos/${{ github.repository }}/statuses/${{ steps.checkout-pr.outputs.commit-sha }} \ | |
| -f state='failure' \ | |
| -f target_url='https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' \ | |
| -f description='Failed' \ | |
| -f context="Uptest-${EXAMPLE_HASH}" |