Repository navigation
ci: move Maven visibility checks off the publisher #1856
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
| # File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. | |
| name: Castiron custom code | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review, edited] | |
| pull_request_review: | |
| types: [submitted, edited, dismissed] | |
| # Notify the existing trusted handler for queue candidates. | |
| merge_group: | |
| types: [checks_requested] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: castiron-custom-code-${{ github.event.pull_request.number || github.event.merge_group.head_ref }} | |
| cancel-in-progress: false | |
| env: | |
| REPORTER_SHA256: a52a1aabf4047f4c20e96d1d788c25a4aa78c1987b4fa73a13d22c92ef213a3f | |
| jobs: | |
| queue-signal: | |
| if: github.event_name == 'merge_group' || github.event_name == 'pull_request_review' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 1 | |
| permissions: {} | |
| steps: | |
| - run: echo 'The workflow_run handler on main evaluates this candidate independently.' | |
| # Candidate tests run on a separate runner and never precede a token-bearing step. | |
| candidate-tests: | |
| if: github.event_name == 'pull_request' | |
| name: Castiron / reporter tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Check out the pull request | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| persist-credentials: false | |
| - name: Test snapshot isolation and the custom-code budget | |
| run: python3 -m unittest discover -s scripts/castiron -p 'test_custom_code*.py' | |
| report: | |
| if: github.event_name == 'pull_request' | |
| name: Castiron / baseline consistency | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Record the pull request | |
| env: | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| REPOSITORY: ${{ github.repository }} | |
| RUN_ID: ${{ github.run_id }} | |
| RUN_ATTEMPT: ${{ github.run_attempt }} | |
| run: | | |
| mkdir -p "$RUNNER_TEMP/castiron-custom-code" | |
| jq -n --argjson pr "$PR_NUMBER" --arg repository "$REPOSITORY" \ | |
| --argjson run "$RUN_ID" --argjson attempt "$RUN_ATTEMPT" \ | |
| '{pr: $pr, repository: $repository, run: $run, attempt: $attempt}' \ | |
| > "$RUNNER_TEMP/castiron-custom-code/context.json" | |
| - name: Check out the pull request | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Verify the reporter matches its generated workflow | |
| run: printf '%s %s\n' "$REPORTER_SHA256" scripts/castiron/custom_code_report.py | sha256sum --check --strict | |
| - name: Validate the codegen hash and report custom code | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GIT_CONFIG_COUNT: '2' | |
| GIT_CONFIG_KEY_0: credential.helper | |
| GIT_CONFIG_VALUE_0: '' | |
| GIT_CONFIG_KEY_1: credential.https://github.com.helper | |
| GIT_CONFIG_VALUE_1: '!gh auth git-credential' | |
| BASE_SHA: ${{ github.event.pull_request.base.sha }} | |
| HEAD_SHA: ${{ github.event.pull_request.head.sha }} | |
| TARGET_BRANCH: ${{ github.event.pull_request.base.ref }} | |
| PUBLIC_REPOSITORY: ${{ !github.event.repository.private }} | |
| run: | | |
| git fetch --quiet --no-tags origin "$BASE_SHA" "$HEAD_SHA" | |
| mode=() | |
| if [[ "$PUBLIC_REPOSITORY" == true ]]; then mode=(--public); fi | |
| python3 -I scripts/castiron/custom_code_report.py report \ | |
| --base "$BASE_SHA" --head "$HEAD_SHA" --target-branch "$TARGET_BRANCH" \ | |
| --fetch --require-head-hash "${mode[@]}" \ | |
| --out "$RUNNER_TEMP/castiron-custom-code" | |
| - name: Add the report to the run summary | |
| if: always() | |
| run: | | |
| if test -f "$RUNNER_TEMP/castiron-custom-code/summary.md"; then | |
| cat "$RUNNER_TEMP/castiron-custom-code/summary.md" >> "$GITHUB_STEP_SUMMARY" | |
| fi | |
| - name: Upload report and current custom-code patch | |
| if: always() | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: castiron-custom-code-${{ github.run_id }}-${{ github.run_attempt }} | |
| path: ${{ runner.temp }}/castiron-custom-code/ | |
| if-no-files-found: error | |
| retention-days: 7 |