name: Ship test records description: >- Gather the job's spooled test records and JUnit files into an artifact for the test-records relay. Credential-free; a gathering failure warns and never fails the job. inputs: artifact: description: >- Artifact name suffix, unique per job and matrix leg; the artifact is uploaded as test-records-. The workflow interpolates matrix values here because an action cannot read the matrix. required: true job: description: Display name of the job, matrix leg included. required: true shard: description: Shard label like "3/8" when the job is sharded. required: false default: "" variant: description: Stable name of a non-default test configuration. required: false default: "" junit: description: >- Newline-separated JUnit ingestion specifications, each kind=,scope=[,prefix=],glob=, with globs relative to the repository root. required: false default: "" runs: using: composite steps: - name: 📤 Gather test records shell: bash env: SHIP_JOB: ${{ inputs.job }} SHIP_SHARD: ${{ inputs.shard }} SHIP_VARIANT: ${{ inputs.variant }} SHIP_JUNIT: ${{ inputs.junit }} run: | args=(--out test-records-artifact --job "$SHIP_JOB") if [ -n "$SHIP_SHARD" ]; then args+=(--shard "$SHIP_SHARD") fi RESOLVED_VARIANT="${SHIP_VARIANT:-${CF_TEST_RECORDS_VARIANT:-}}" if [ -n "$RESOLVED_VARIANT" ]; then args+=(--variant "$RESOLVED_VARIANT") fi while IFS= read -r spec; do if [ -n "$spec" ]; then args+=(--junit "$spec") fi done <<< "$SHIP_JUNIT" deno run --allow-read --allow-write --allow-env --allow-run=git \ tasks/test-records-gather.ts "${args[@]}" # The attempt is part of the artifact name: artifacts are scoped to # the run, not the attempt, so a re-run's jobs would otherwise collide # with attempt one's names, and the relay needs to tell which attempt # produced each artifact to keep re-ships idempotent without dropping # a re-run job's new records. - name: 📤 Upload test records uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: test-records-${{ inputs.artifact }}-a${{ github.run_attempt }} path: test-records-artifact/ retention-days: 90 if-no-files-found: ignore