|
| 1 | +--- |
| 2 | +name: CI Test |
| 3 | + |
| 4 | +on: |
| 5 | + issue_comment: |
| 6 | + types: [created] |
| 7 | + |
| 8 | +jobs: |
| 9 | + check-pull-request: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + if: ${{ github.event.issue.pull_request && |
| 12 | + (endsWith(github.event.comment.body, '/test')) }} |
| 13 | + steps: |
| 14 | + - name: Query author repository permissions |
| 15 | + uses: octokit/request-action@v2.x |
| 16 | + id: user_permission |
| 17 | + with: |
| 18 | + route: GET /repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}/permission |
| 19 | + env: |
| 20 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 21 | + |
| 22 | + - name: Check if user does have correct permissions |
| 23 | + if: contains('admin write', fromJson(steps.user_permission.outputs.data).permission) |
| 24 | + id: check_user_perm |
| 25 | + run: | |
| 26 | + echo "User '${{ github.event.sender.login }}' has permission '${{ fromJson(steps.user_permission.outputs.data).permission }}' allowed values: 'admin', 'write'" |
| 27 | + echo "allowed_user=true" >> $GITHUB_OUTPUT |
| 28 | +
|
| 29 | + - name: Get information for pull request |
| 30 | + uses: octokit/request-action@v2.x |
| 31 | + id: pr-api |
| 32 | + with: |
| 33 | + route: GET /repos/${{ github.repository }}/pulls/${{ github.event.issue.number }} |
| 34 | + env: |
| 35 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 36 | + |
| 37 | + outputs: |
| 38 | + allowed_user: ${{ steps.check_user_perm.outputs.allowed_user }} |
| 39 | + sha: ${{ fromJson(steps.pr-api.outputs.data).head.sha }} |
| 40 | + ref: ${{ fromJson(steps.pr-api.outputs.data).head.ref }} |
| 41 | + repo_url: ${{ fromJson(steps.pr-api.outputs.data).head.repo.html_url }} |
| 42 | + |
| 43 | + centos-10-bootc: |
| 44 | + needs: check-pull-request |
| 45 | + if: ${{ needs.check-pull-request.outputs.allowed_user == 'true' }} |
| 46 | + continue-on-error: true |
| 47 | + runs-on: ubuntu-latest |
| 48 | + |
| 49 | + steps: |
| 50 | + - name: Run the tests |
| 51 | + uses: sclorg/testing-farm-as-github-action@v3.1.2 |
| 52 | + with: |
| 53 | + compose: CentOS-Stream-10 |
| 54 | + api_key: ${{ secrets.TF_API_KEY }} |
| 55 | + git_url: ${{ needs.check-pull-request.outputs.repo_url }} |
| 56 | + git_ref: ${{ needs.check-pull-request.outputs.ref }} |
| 57 | + update_pull_request_status: true |
| 58 | + pull_request_status_name: centos-10-bootc |
| 59 | + tmt_context: "arch=x86_64;distro=cs-10" |
| 60 | + tmt_plan_regex: bootc |
| 61 | + tf_scope: private |
| 62 | + variables: "ARCH=x86_64" |
| 63 | + timeout: 90 |
| 64 | + secrets: "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }}" |
| 65 | + |
| 66 | + fedora-43-bootc: |
| 67 | + needs: check-pull-request |
| 68 | + if: ${{ needs.check-pull-request.outputs.allowed_user == 'true' }} |
| 69 | + continue-on-error: true |
| 70 | + runs-on: ubuntu-latest |
| 71 | + |
| 72 | + steps: |
| 73 | + - name: Run the tests |
| 74 | + uses: sclorg/testing-farm-as-github-action@v3.1.2 |
| 75 | + with: |
| 76 | + compose: Fedora-43 |
| 77 | + api_key: ${{ secrets.TF_API_KEY }} |
| 78 | + git_url: ${{ needs.check-pull-request.outputs.repo_url }} |
| 79 | + git_ref: ${{ needs.check-pull-request.outputs.ref }} |
| 80 | + update_pull_request_status: true |
| 81 | + pull_request_status_name: fedora-43-bootc |
| 82 | + tmt_context: "arch=x86_64;distro=fedora-43" |
| 83 | + tmt_plan_regex: bootc |
| 84 | + tf_scope: private |
| 85 | + variables: "ARCH=x86_64" |
| 86 | + timeout: 90 |
| 87 | + secrets: "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }}" |
| 88 | + |
| 89 | + fedora-44-bootc: |
| 90 | + needs: check-pull-request |
| 91 | + if: ${{ needs.check-pull-request.outputs.allowed_user == 'true' }} |
| 92 | + continue-on-error: true |
| 93 | + runs-on: ubuntu-latest |
| 94 | + |
| 95 | + steps: |
| 96 | + - name: Run the tests |
| 97 | + uses: sclorg/testing-farm-as-github-action@v3.1.2 |
| 98 | + with: |
| 99 | + compose: Fedora-Rawhide |
| 100 | + api_key: ${{ secrets.TF_API_KEY }} |
| 101 | + git_url: ${{ needs.check-pull-request.outputs.repo_url }} |
| 102 | + git_ref: ${{ needs.check-pull-request.outputs.ref }} |
| 103 | + update_pull_request_status: true |
| 104 | + pull_request_status_name: fedora-44-bootc |
| 105 | + tmt_context: "arch=x86_64;distro=fedora-44" |
| 106 | + tmt_plan_regex: bootc |
| 107 | + tf_scope: private |
| 108 | + variables: "ARCH=x86_64" |
| 109 | + timeout: 90 |
| 110 | + secrets: "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }}" |
| 111 | + |
| 112 | + centos-9-ostree: |
| 113 | + needs: check-pull-request |
| 114 | + if: ${{ needs.check-pull-request.outputs.allowed_user == 'true' }} |
| 115 | + continue-on-error: true |
| 116 | + runs-on: ubuntu-latest |
| 117 | + |
| 118 | + steps: |
| 119 | + - name: Run the tests |
| 120 | + uses: sclorg/testing-farm-as-github-action@v3.1.2 |
| 121 | + with: |
| 122 | + compose: CentOS-Stream-9 |
| 123 | + api_key: ${{ secrets.TF_API_KEY }} |
| 124 | + git_url: ${{ needs.check-pull-request.outputs.repo_url }} |
| 125 | + git_ref: ${{ needs.check-pull-request.outputs.ref }} |
| 126 | + update_pull_request_status: true |
| 127 | + pull_request_status_name: centos-9-ostree |
| 128 | + tmt_context: "arch=x86_64;distro=cs-9" |
| 129 | + tmt_plan_regex: ostree |
| 130 | + tf_scope: private |
| 131 | + variables: "ARCH=x86_64" |
| 132 | + timeout: 90 |
| 133 | + secrets: "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }}" |
0 commit comments