GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — kafka/.github/workflows/build.yml at trunk · mimaison/kafka 389 lines (368 loc) · 14.3 KB / Copy pathbuild.ymlFile metadata and controls389 lines (368 loc) · 14.3 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. name: Check and Test # This workflow should only be called from ci.yml which is triggered on # the "pull_request" event type. We should never dispatch this workflow from # a "pull_request_target" event. on: workflow_call: inputs: is-trunk: description: "Is this a trunk build?" default: true type: boolean is-public-fork: description: "Is this CI run from a public fork?" default: true type: boolean jobs: configure: runs-on: ubuntu-latest name: Configure Workflow outputs: is-draft: ${{ steps.check-draft-pr.outputs.is-draft }} test-catalog-days: ${{ steps.configure-outputs.outputs.days }} sha: ${{ steps.configure-outputs.outputs.sha }} steps: - name: Env run: printenv env: GITHUB_CONTEXT: ${{ toJson(github) }} - name: Check for Draft PR id: check-draft-pr if: | github.event_name == 'pull_request' && github.event.pull_request.draft run: echo "is-draft=true" >> "$GITHUB_OUTPUT" - name: Configure Outputs id: configure-outputs run: | if [ "${{ github.event_name }}" = "pull_request" ]; then echo "days=0" >> "$GITHUB_OUTPUT" echo "sha=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT" else echo "days=7" >> "$GITHUB_OUTPUT" echo "sha=${{ github.sha }}" >> "$GITHUB_OUTPUT" fi load-catalog: needs: [configure] runs-on: ubuntu-latest name: Load Test Catalog steps: - name: Checkout main uses: actions/checkout@v4 with: persist-credentials: false - name: Checkout test-catalog uses: actions/checkout@v4 with: ref: 'test-catalog' persist-credentials: false fetch-depth: 100 # Needs to be large enough to ensure we can fetch N days ago path: test-catalog - name: Checkout catalog at earlier date if: ${{ needs.configure.outputs.test-catalog-days != '0' }} env: DAYS: ${{ needs.configure.outputs.test-catalog-days }} run: | cd test-catalog SHA=$(git rev-list -1 --before $DAYS.days.ago origin/test-catalog) echo $SHA git switch --detach $SHA git show --no-patch - name: Setup Python uses: ./.github/actions/setup-python # Prior to this step, we don't expect any errors. For the rest of this "load-catalog" job, we need to ensure # we do not fail as this will fail the overall workflow. - name: Combine Catalog into single file id: combine-catalog continue-on-error: true run: | python .github/scripts/format-test-catalog.py --path "test-catalog/test-catalog/**/*.yaml" - name: Archive Combined Test Catalog if: steps.combine-catalog.outcome == 'success' uses: actions/upload-artifact@v4 with: name: combined-test-catalog path: combined-test-catalog.txt compression-level: 9 validate: needs: [configure] runs-on: ubuntu-latest name: Compile and Check (Merge Ref) steps: - name: Env run: printenv env: GITHUB_CONTEXT: ${{ toJson(github) }} - name: Checkout code uses: actions/checkout@v4 with: persist-credentials: false ref: ${{ github.sha }} # this is the default, just being explicit. - name: Setup Python uses: ./.github/actions/setup-python - name: Setup Gradle uses: ./.github/actions/setup-gradle with: java-version: 23 gradle-cache-read-only: ${{ !inputs.is-trunk }} gradle-cache-write-only: ${{ inputs.is-trunk }} develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} - name: Compile and validate env: SCAN_ARG: ${{ inputs.is-public-fork && '--no-scan' || '--scan' }} # Gradle flags # --build-cache: Let Gradle restore the build cache # --info: For now, we'll generate lots of logs while setting up the GH Actions # --scan: Publish the build scan. This will only work on PRs from apache/kafka and trunk # --no-scan: For public fork PRs, we won't attempt to publish the scan run: | ./gradlew --build-cache --info $SCAN_ARG check releaseTarGz -x test - name: Archive check reports if: always() uses: actions/upload-artifact@v4 with: name: check-reports path: | **/build/**/*.html compression-level: 9 if-no-files-found: ignore - name: Annotate checkstyle errors if: failure() run: python .github/scripts/checkstyle.py env: GITHUB_WORKSPACE: ${{ github.workspace }} - name: Annotate Rat errors if: failure() run: python .github/scripts/rat.py env: GITHUB_WORKSPACE: ${{ github.workspace }} - name: Check generated documentation # Check if there are any empty files under ./site-docs/generated, If any empty files are found, print an error # message and list the empty files run: | tar zxvf core/build/distributions/kafka_2.13-$(./gradlew properties | grep version: | awk '{print $NF}' | head -n 1)-site-docs.tgz if find ./site-docs/generated -type f -exec grep -L "." {} \; | grep -q "."; then echo "One or more documentation files are empty!" >&2 find ./site-docs/generated -type f -exec grep -L "." {} \; >&2 exit 1 fi - name: Verify license file run: python committer-tools/verify_license.py --skip-build test: needs: [configure, validate, load-catalog] if: ${{ ! needs.configure.outputs.is-draft }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: # If we change these, make sure to adjust ci-complete.yml java: [ 23, 17 ] run-flaky: [ true, false ] run-new: [ true, false ] exclude: - run-flaky: true run-new: true env: job-variation: ${{ matrix.java }}-${{ matrix.run-flaky == true && 'flaky' || 'noflaky' }}-${{ matrix.run-new == true && 'new' || 'nonew' }} name: JUnit tests Java ${{ matrix.java }}${{ matrix.run-flaky == true && ' (flaky)' || '' }}${{ matrix.run-new == true && ' (new)' || '' }} steps: - name: Checkout code uses: actions/checkout@v4 with: persist-credentials: false ref: ${{ needs.configure.outputs.sha }} - name: Setup Python uses: ./.github/actions/setup-python - name: Setup Gradle uses: ./.github/actions/setup-gradle with: java-version: ${{ matrix.java }} gradle-cache-read-only: ${{ !inputs.is-trunk }} gradle-cache-write-only: ${{ inputs.is-trunk }} develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} # If the load-catalog job failed, we won't be able to download the artifact. Since we don't want this to fail # the overall workflow, so we'll continue here without a test catalog. - name: Load Test Catalog id: load-test-catalog uses: actions/download-artifact@v4 continue-on-error: true with: name: combined-test-catalog - name: JUnit Tests id: junit-test uses: ./.github/actions/run-gradle with: test-task: test timeout-minutes: 180 # 3 hours test-catalog-path: ${{ steps.load-test-catalog.outputs.download-path }}/combined-test-catalog.txt build-scan-artifact-name: build-scan-${{ env.job-variation }} run-new-tests: ${{ matrix.run-new }} run-flaky-tests: ${{ matrix.run-flaky }} test-retries: ${{ matrix.run-flaky == true && '3' || '1' }} test-xml-output: ${{ env.job-variation }} test-repeat: ${{ !inputs.is-trunk && matrix.run-new && '3' || '1' }} test-verbose: ${{ runner.debug == '1' }} - name: Archive JUnit HTML reports uses: actions/upload-artifact@v4 id: archive-junit-html with: name: junit-reports-${{ env.job-variation }} path: | **/build/reports/tests/* compression-level: 9 if-no-files-found: ignore - name: Archive JUnit XML uses: actions/upload-artifact@v4 with: name: junit-xml-${{ env.job-variation }} path: | build/junit-xml/**/*.xml compression-level: 9 if-no-files-found: ignore - name: Archive Thread Dumps id: archive-thread-dump if: steps.junit-test.outputs.gradle-exitcode == '124' uses: actions/upload-artifact@v4 with: name: junit-thread-dumps-${{ env.job-variation }} path: | thread-dumps/* compression-level: 9 if-no-files-found: ignore - name: Parse JUnit tests env: GITHUB_WORKSPACE: ${{ github.workspace }} JUNIT_REPORT_URL: ${{ steps.archive-junit-html.outputs.artifact-url }} THREAD_DUMP_URL: ${{ steps.archive-thread-dump.outputs.artifact-url }} GRADLE_TEST_EXIT_CODE: ${{ steps.junit-test.outputs.gradle-exitcode }} run: | python .github/scripts/junit.py \ --path build/junit-xml >> $GITHUB_STEP_SUMMARY # This job downloads all the JUnit XML files and thread dumps from the JDK 23 test runs. # If any test job fails, we will not run this job. Also, if any thread dump artifacts # are present, this means there was a timeout in the tests and so we will not proceed # with catalog creation. collate-test-catalog: name: Collate Test Catalog needs: test runs-on: ubuntu-latest outputs: uploaded-test-catalog: ${{ steps.archive-test-catalog.outcome == 'success' }} steps: - name: Checkout code uses: actions/checkout@v4 with: persist-credentials: false - name: Download Thread Dumps uses: actions/download-artifact@v4 with: pattern: junit-thread-dumps-23-* path: thread-dumps merge-multiple: true - name: Check For Thread Dump id: check-for-thread-dump run: | find . if [ -d thread-dumps ]; then echo "Found 'thread-dumps' directory. Will not proceed with test catalog collation."; exit 1; fi - name: Download JUnit XMLs uses: actions/download-artifact@v4 with: pattern: junit-xml-23-* # Only look at JDK 23 tests for the test catalog path: junit-xml merge-multiple: true - name: Collate Test Catalog continue-on-error: true env: GITHUB_WORKSPACE: ${{ github.workspace }} GRADLE_TEST_EXIT_CODE: 0 run: | python .github/scripts/junit.py \ --path junit-xml \ --export-test-catalog ./test-catalog >> $GITHUB_STEP_SUMMARY - name: Archive Test Catalog id: archive-test-catalog uses: actions/upload-artifact@v4 with: name: test-catalog path: test-catalog compression-level: 9 if-no-files-found: error # This job downloads the test catalog from the previous job and overlays it on the test-catalog branch. # This will only run on trunk and only if the collate job did not detect a timeout. update-test-catalog: name: Update Test Catalog needs: collate-test-catalog if: ${{ inputs.is-trunk && needs.collate-test-catalog.outputs.uploaded-test-catalog == 'true' }} runs-on: ubuntu-latest permissions: contents: write steps: - name: Checkout Test Catalog uses: actions/checkout@v4 with: persist-credentials: true # Needed to commit and push later ref: test-catalog - name: Reset Catalog run: | rm -rf test-catalog - name: Download Test Catalog uses: actions/download-artifact@v4 with: name: test-catalog path: test-catalog - name: Push Test Catalog # Git user.name and user.email come from https://github.com/actions/checkout?tab=readme-ov-file#push-a-commit-using-the-built-in-token env: COMMIT_MSG: | Update test catalog data for GHA workflow run ${{ github.run_id }} Commit: https://github.com/apache/kafka/commit/${{ github.sha }} GitHub Run: https://github.com/apache/kafka/actions/runs/${{ github.run_id }} run: | pwd ls -R git config user.name 'github-actions[bot]' git config user.email '41898282+github-actions[bot]@users.noreply.github.com' git add test-catalog git diff --quiet && git diff --staged --quiet || git commit -m "$COMMIT_MSG" git push checks-complete: name: "CI checks completed" needs: [configure, validate, test] if: always() runs-on: ubuntu-latest steps: - name: Env run: printenv env: GITHUB_CONTEXT: ${{ toJson(github) }} - name: Fail if Draft if: ${{ needs.configure.outputs.is-draft }} run: | echo "Cannot merge a draft PR" exit 1 - name: Check Dependency Outcomes run: | if [[ "${{ needs.validate.result }}" == "success" && "${{ needs.test.result }}" == "success" ]]; then echo "Required jobs completed successfully!" exit 0 else echo "Required jobs did not complete successfully" exit 1 fi |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |