|
| 1 | +name: gate |
| 2 | +on: |
| 3 | + merge_group: |
| 4 | + types: |
| 5 | + - checks_requested |
| 6 | +jobs: |
| 7 | + prepare-env: |
| 8 | + runs-on: |
| 9 | + group: infra1-runners-arc |
| 10 | + labels: runners-small |
| 11 | + outputs: |
| 12 | + branch: ${{ steps.branch.outputs.branch }} |
| 13 | + ref: ${{ github.event.merge_group.head_ref }} |
| 14 | + commit: ${{ github.event.merge_group.head_sha }} |
| 15 | + pr_number: ${{ steps.pr-number.outputs.pr_number }} |
| 16 | + project: ${{ github.repository }} |
| 17 | + changed_files: ${{ steps.changed-files.outputs.all_changed_files }} |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + fetch-depth: 0 |
| 22 | + - name: Get changed files |
| 23 | + id: changed-files |
| 24 | + uses: tj-actions/changed-files@v40 |
| 25 | + - name: Branch name |
| 26 | + id: branch |
| 27 | + run: |- |
| 28 | + branch=$(echo "${{ github.event.merge_group.base_ref }}" | sed 's/^refs\/heads\///') |
| 29 | + echo "branch=$branch" >> "$GITHUB_OUTPUT" |
| 30 | +
|
| 31 | + - name: PR number |
| 32 | + id: pr-number |
| 33 | + run: |- |
| 34 | + pr_num=$(echo "${{ github.ref }}" | sed -n 's/.*pr-\([0-9]*\).*/\1/p') |
| 35 | + echo "pr_number=$pr_num" >> "$GITHUB_OUTPUT" |
| 36 | +
|
| 37 | + gooddata-react-components-fossa-licenses-validate-LR-ticket-zuul: |
| 38 | + runs-on: |
| 39 | + group: infra1-runners-arc |
| 40 | + labels: runners-small |
| 41 | + needs: |
| 42 | + - prepare-env |
| 43 | + permissions: |
| 44 | + contents: read |
| 45 | + id-token: write |
| 46 | + steps: |
| 47 | + - name: Check if any matching file changed |
| 48 | + id: changed-files |
| 49 | + run: | |
| 50 | + any_changed=false |
| 51 | + patterns=('^NOTICE(S)?(.TXT)?$' '^LICENSE(S)?(.TXT)?$') |
| 52 | + for file in ${{ needs.prepare-env.outputs.changed_files }}; do |
| 53 | + for pattern in "${patterns[@]}"; do |
| 54 | + if [[ $file =~ $pattern ]]; then |
| 55 | + any_changed=true |
| 56 | + fi |
| 57 | + done |
| 58 | + done |
| 59 | + echo "any_changed=$any_changed" >> "$GITHUB_OUTPUT" |
| 60 | + - name: Call Jenkins trigger |
| 61 | + id: call-jenkins |
| 62 | + uses: gooddata/github-actions-public/jenkins/trigger@master |
| 63 | + with: |
| 64 | + server: ${{ secrets.JENKINS_ADDRESS }} |
| 65 | + folder: compliance |
| 66 | + job-name: gooddata-react-components-fossa-licenses-validate-LR-ticket-zuul |
| 67 | + vault-url: ${{ secrets.VAULT_ADDRESS }} |
| 68 | + params: |- |
| 69 | + { |
| 70 | + "GH_BRANCH": "${{ needs.prepare-env.outputs.branch }}", |
| 71 | + "GH_REF": "${{ needs.prepare-env.outputs.ref }}", |
| 72 | + "GH_COMMIT": "${{ needs.prepare-env.outputs.commit }}", |
| 73 | + "GH_URL": "git@github.com:", |
| 74 | + "GH_CHANGE": "${{ needs.prepare-env.outputs.pr_number }}", |
| 75 | + "GH_PROJECT": "${{ needs.prepare-env.outputs.project }}", |
| 76 | + "BUILD_BY_GITHUB": "true", |
| 77 | + "GH_PIPELINE": "gate" |
| 78 | + } |
| 79 | + comment-pr: "true" |
| 80 | + if: steps.changed-files.outputs.any_changed == 'true' |
| 81 | + gooddata-react-components-unit-tests-zuul-docker: |
| 82 | + runs-on: |
| 83 | + group: infra1-runners-arc |
| 84 | + labels: runners-small |
| 85 | + needs: |
| 86 | + - gooddata-react-components-fossa-licenses-validate-LR-ticket-zuul |
| 87 | + - prepare-env |
| 88 | + permissions: |
| 89 | + contents: read |
| 90 | + id-token: write |
| 91 | + steps: |
| 92 | + - name: Call Jenkins trigger |
| 93 | + id: call-jenkins |
| 94 | + uses: gooddata/github-actions-public/jenkins/trigger@master |
| 95 | + with: |
| 96 | + server: ${{ secrets.JENKINS_ADDRESS }} |
| 97 | + folder: client-libs |
| 98 | + job-name: gooddata-react-components-unit-tests-zuul-docker |
| 99 | + vault-url: ${{ secrets.VAULT_ADDRESS }} |
| 100 | + params: |- |
| 101 | + { |
| 102 | + "GH_BRANCH": "${{ needs.prepare-env.outputs.branch }}", |
| 103 | + "GH_REF": "${{ needs.prepare-env.outputs.ref }}", |
| 104 | + "GH_COMMIT": "${{ needs.prepare-env.outputs.commit }}", |
| 105 | + "GH_URL": "git@github.com:", |
| 106 | + "GH_CHANGE": "${{ needs.prepare-env.outputs.pr_number }}", |
| 107 | + "GH_PROJECT": "${{ needs.prepare-env.outputs.project }}", |
| 108 | + "BUILD_BY_GITHUB": "true", |
| 109 | + "GH_PIPELINE": "gate" |
| 110 | + } |
| 111 | + comment-pr: "true" |
| 112 | + gooddata-react-components-storybook-zuul-docker: |
| 113 | + runs-on: |
| 114 | + group: infra1-runners-arc |
| 115 | + labels: runners-small |
| 116 | + needs: |
| 117 | + - gooddata-react-components-fossa-licenses-validate-LR-ticket-zuul |
| 118 | + - prepare-env |
| 119 | + permissions: |
| 120 | + contents: read |
| 121 | + id-token: write |
| 122 | + steps: |
| 123 | + - name: Call Jenkins trigger |
| 124 | + id: call-jenkins |
| 125 | + uses: gooddata/github-actions-public/jenkins/trigger@master |
| 126 | + with: |
| 127 | + server: ${{ secrets.JENKINS_ADDRESS }} |
| 128 | + folder: client-libs |
| 129 | + job-name: gooddata-react-components-storybook-zuul-docker |
| 130 | + vault-url: ${{ secrets.VAULT_ADDRESS }} |
| 131 | + params: |- |
| 132 | + { |
| 133 | + "GH_BRANCH": "${{ needs.prepare-env.outputs.branch }}", |
| 134 | + "GH_REF": "${{ needs.prepare-env.outputs.ref }}", |
| 135 | + "GH_COMMIT": "${{ needs.prepare-env.outputs.commit }}", |
| 136 | + "GH_URL": "git@github.com:", |
| 137 | + "GH_CHANGE": "${{ needs.prepare-env.outputs.pr_number }}", |
| 138 | + "GH_PROJECT": "${{ needs.prepare-env.outputs.project }}", |
| 139 | + "BUILD_BY_GITHUB": "true", |
| 140 | + "GH_PIPELINE": "gate" |
| 141 | + } |
| 142 | + comment-pr: "true" |
| 143 | + ready-to-merge: |
| 144 | + runs-on: |
| 145 | + group: infra1-runners-arc |
| 146 | + labels: runners-small |
| 147 | + if: always() |
| 148 | + needs: |
| 149 | + - prepare-env |
| 150 | + - gooddata-react-components-fossa-licenses-validate-LR-ticket-zuul |
| 151 | + - gooddata-react-components-unit-tests-zuul-docker |
| 152 | + - gooddata-react-components-storybook-zuul-docker |
| 153 | + steps: |
| 154 | + - name: Check if needed jobs succeeded |
| 155 | + uses: re-actors/alls-green@release/v1 |
| 156 | + with: |
| 157 | + allowed-skips: ${{ toJSON(needs) }} |
| 158 | + jobs: ${{ toJSON(needs) }} |
0 commit comments