|
| 1 | +name: Nightly cockroach-go tests |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + sha: |
| 7 | + description: 'SHA to run against' |
| 8 | + required: false |
| 9 | + type: string |
| 10 | + file_issue_branch: |
| 11 | + description: 'Branch used in filed issues; if unset, no issues are filed' |
| 12 | + required: false |
| 13 | + type: string |
| 14 | + bootstrap_go_version: |
| 15 | + description: 'Bootstrap Go version' |
| 16 | + required: false |
| 17 | + default: '1.25' |
| 18 | + type: string |
| 19 | + go_branch: |
| 20 | + description: 'CockroachDB Go fork branch' |
| 21 | + required: true |
| 22 | + type: string |
| 23 | + workflow_dispatch: |
| 24 | + inputs: |
| 25 | + sha: |
| 26 | + description: 'SHA to run against' |
| 27 | + required: false |
| 28 | + type: string |
| 29 | + file_issue_branch: |
| 30 | + description: 'Branch used in filed issues; if unset, no issues are filed' |
| 31 | + required: false |
| 32 | + type: string |
| 33 | + bootstrap_go_version: |
| 34 | + description: 'Bootstrap Go version' |
| 35 | + required: false |
| 36 | + default: '1.25' |
| 37 | + type: string |
| 38 | + go_branch: |
| 39 | + description: 'CockroachDB Go fork branch' |
| 40 | + required: true |
| 41 | + type: string |
| 42 | + |
| 43 | +jobs: |
| 44 | + linux-cockroach-go: |
| 45 | + name: linux-cockroach-go |
| 46 | + runs-on: ubuntu-latest |
| 47 | + env: |
| 48 | + GO_BRANCH: ${{ inputs.go_branch }} |
| 49 | + |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@v4 |
| 52 | + with: |
| 53 | + ref: ${{ inputs.sha || github.sha }} |
| 54 | + |
| 55 | + # Step 1: Fetch the branch tip SHA for cache key |
| 56 | + - name: Get cockroachdb/go commit hash |
| 57 | + id: go-sha |
| 58 | + run: | |
| 59 | + SHA=$(git ls-remote https://github.com/cockroachdb/go.git refs/heads/$GO_BRANCH | cut -f1) |
| 60 | + echo "GO_SHA=$SHA" >> $GITHUB_ENV |
| 61 | +
|
| 62 | + # Step 2: Restore cache (per branch + commit SHA) |
| 63 | + - name: Cache custom Go toolchain |
| 64 | + uses: actions/cache@v4 |
| 65 | + with: |
| 66 | + path: ~/.cache/cockroachdb-go/${{ env.GO_SHA }} |
| 67 | + key: cockroachdb-${{ env.GO_SHA }} |
| 68 | + |
| 69 | + # Step 3: Install bootstrap Go (needed to build fork) |
| 70 | + - name: Install bootstrap Go |
| 71 | + uses: actions/setup-go@v5 |
| 72 | + with: |
| 73 | + go-version: ${{ inputs.bootstrap_go_version }} |
| 74 | + |
| 75 | + # Step 4: Run tests with custom Go |
| 76 | + - run: ./scripts/run-tests-with-custom-go.sh -tags invariants ./... |
| 77 | + |
| 78 | + - name: Post issue on failure |
| 79 | + if: failure() && inputs.file_issue_branch != '' |
| 80 | + id: create-or-update-unique-issue |
| 81 | + uses: ./.github/actions/post-issue |
| 82 | + with: |
| 83 | + title: "${{ inputs.file_issue_branch }}: nightly ${{ github.job }} failed" |
| 84 | + body: "The nightly ${{ github.job }} test run failed on ${{ inputs.sha }}. Please review the run [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})." |
| 85 | + labels: "C-test-failure" |
0 commit comments