-
Notifications
You must be signed in to change notification settings - Fork 141
ci: shard java tests #6337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: shard java tests #6337
Changes from all commits
db42fea
b363509
a5ab793
afefb36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: 'Feldera MinIO cache' | ||
| description: | | ||
| Wrapper around runs-on/cache that targets the in-cluster MinIO bucket used | ||
| for GitHub Actions caches (default: gha-cache). The caller is responsible | ||
| for providing AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, SCCACHE_REGION, | ||
| and SCCACHE_ENDPOINT in the job or workflow env — they double as sccache | ||
| config in every workflow that uses this action. | ||
|
|
||
| inputs: | ||
| path: | ||
| description: 'Newline-separated list of paths to cache' | ||
| required: true | ||
| key: | ||
| description: 'Primary cache key' | ||
| required: true | ||
| restore-keys: | ||
| description: 'Newline-separated fallback restore keys' | ||
| required: false | ||
| default: '' | ||
| bucket: | ||
| description: 'MinIO bucket name' | ||
| required: false | ||
| default: 'gha-cache' | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - uses: runs-on/cache@88d90644011a3a9957fd141a106f5a94f9794203 # v5.0.7 | ||
| env: | ||
| AWS_REGION: ${{ env.SCCACHE_REGION }} | ||
| AWS_ENDPOINT_URL: http://${{ env.SCCACHE_ENDPOINT }} | ||
| AWS_S3_FORCE_PATH_STYLE: "true" | ||
| RUNS_ON_S3_BUCKET_CACHE: ${{ inputs.bucket }} | ||
| # Defend against AWS_SESSION_TOKEN leaking from a configure-aws-credentials | ||
| # step run earlier in the job — MinIO rejects requests carrying it. | ||
| AWS_SESSION_TOKEN: "" | ||
| with: | ||
| path: ${{ inputs.path }} | ||
| key: ${{ inputs.key }} | ||
| restore-keys: ${{ inputs.restore-keys }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,27 +12,42 @@ env: | |
| SCCACHE_REGION: ${{ vars.SCCACHE_REGION }} | ||
| AWS_ACCESS_KEY_ID: "${{ secrets.CI_K8S_MINIO_ACCESS_KEY_ID }}" | ||
| AWS_SECRET_ACCESS_KEY: "${{ secrets.CI_K8S_MINIO_SECRET_ACCESS_KEY }}" | ||
| # sccache cannot cache rustc invocations when incremental is on. | ||
| CARGO_INCREMENTAL: 0 | ||
|
|
||
| jobs: | ||
| # This job needs to be called main (the same as the ci.yml workflow) | ||
| # because of how merge queues work: https://stackoverflow.com/a/78030618 | ||
| main: | ||
| container: | ||
| image: ghcr.io/feldera/feldera-dev:sha-3613839bd73108aee58017bf75dda42f7a3d0bb4 | ||
| image: ghcr.io/feldera/feldera-dev:sha-a5ab793b8d261068867b9fdfad3f04157b2536fc | ||
| runs-on: [k8s-runners-amd64] | ||
| steps: | ||
| - name: Show Kubernetes node | ||
| if: always() | ||
| run: | | ||
| echo "K8S node: ${K8S_NODE_NAME}" | ||
|
|
||
| # Compute the internal-PR boolean once so individual steps can reference | ||
| # it; cheaper to grep and less fragile when triggers expand. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice consolidation — |
||
| - name: Determine if this is an internal PR | ||
| id: pr-check | ||
| run: | | ||
| if [[ "${{ github.event_name }}" == "pull_request" \ | ||
| && "${{ github.event.pull_request.head.repo.full_name }}" == "${{ github.repository }}" \ | ||
| && "${{ github.actor }}" != "dependabot[bot]" ]]; then | ||
| echo "internal=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "internal=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Disable sccache for fork/dependabot PRs (secrets unavailable) | ||
| if: ${{ github.event.pull_request.head.repo.full_name != github.repository || github.actor == 'dependabot[bot]' }} | ||
| if: ${{ steps.pr-check.outputs.internal != 'true' }} | ||
| run: | | ||
| echo "RUSTC_WRAPPER=" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Generate GitHub App token | ||
| if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }} | ||
| if: ${{ steps.pr-check.outputs.internal == 'true' }} | ||
| id: app-token | ||
| uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2 | ||
| with: | ||
|
|
@@ -41,34 +56,42 @@ jobs: | |
| permission-contents: write | ||
|
|
||
| - name: Checkout (internal PRs) | ||
| if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }} | ||
| if: ${{ steps.pr-check.outputs.internal == 'true' }} | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
| with: | ||
| # This needs to be set to a token to trigger a follow-up workflow | ||
| # in case some changes were corrected. | ||
| token: ${{ steps.app-token.outputs.token }} | ||
|
|
||
| - name: Checkout (fork/dependabot PRs) | ||
| if: ${{ github.event.pull_request.head.repo.full_name != github.repository || github.actor == 'dependabot[bot]' }} | ||
| if: ${{ steps.pr-check.outputs.internal != 'true' }} | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
|
|
||
| # Caching is skipped for fork/dependabot PRs: MinIO secrets aren't | ||
| # available in those contexts. | ||
| - name: Cache uv pre-commit environments | ||
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 | ||
| if: ${{ steps.pr-check.outputs.internal == 'true' }} | ||
| uses: ./.github/actions/feldera-minio-cache | ||
| with: | ||
| path: | | ||
| ~/.cache/pre-commit | ||
| ~/.cache/uv | ||
| key: pre-commit-uv-1|${{ hashFiles('.pre-commit-config.yaml') }} | ||
| key: ci-pre-mergequeue-precommit-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.pre-commit-config.yaml') }} | ||
| restore-keys: | | ||
| ci-pre-mergequeue-precommit-${{ runner.os }}-${{ runner.arch }}- | ||
|
|
||
| - name: Cache Cargo registry and index | ||
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 | ||
| if: ${{ steps.pr-check.outputs.internal == 'true' }} | ||
| uses: ./.github/actions/feldera-minio-cache | ||
| with: | ||
| # registry/src excluded — cargo regenerates it from registry/cache. | ||
| path: | | ||
| ~/.cargo/registry | ||
| ~/.cargo/git | ||
| key: cargo-registry-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} | ||
| ~/.cargo/registry/cache | ||
| ~/.cargo/registry/index | ||
| ~/.cargo/git/db | ||
| key: ci-pre-mergequeue-cargo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/Cargo.lock') }} | ||
| restore-keys: | | ||
| cargo-registry-${{ runner.os }}-${{ matrix.target }}- | ||
| ci-pre-mergequeue-cargo-${{ runner.os }}-${{ runner.arch }}- | ||
|
|
||
| - run: | | ||
| # Don't build the webconsole for rust checks | ||
|
|
@@ -89,7 +112,7 @@ jobs: | |
| run: sccache --show-stats | ||
| - uses: stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 # b863ae1933cb653a53c021fe36dbb774e1fb9403 | ||
| # Only attempt auto-fix commits for internal branches (forks and dependabot can't be pushed to) | ||
| if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }} | ||
| if: ${{ always() && steps.pr-check.outputs.internal == 'true' }} | ||
| with: | ||
| commit_message: "[ci] apply automatic fixes" | ||
| commit_user_name: feldera-bot | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny consistency nit:
RUST_TEST_THREADSintest-unit.ymlandtest-adapters.ymlis set at the env level;CARGO_BUILD_JOBShere is also env-level. Good. The fallback|| 20is duplicated five times across workflows — fine for now, but if the answer ever needs to change you’ll touch five files. A repo-levelvars.CI_RUNNER_CORESset to20would let you drop the|| 20literal everywhere.