|
| 1 | +name: Check sdk-go compatibility |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + sdk_ref: |
| 7 | + description: sdk-go ref to check ("latest" for latest release tag) |
| 8 | + required: true |
| 9 | + default: latest |
| 10 | + api_ref: |
| 11 | + description: api-go ref to check |
| 12 | + required: true |
| 13 | + default: master |
| 14 | + workflow_call: |
| 15 | + inputs: |
| 16 | + sdk_ref: |
| 17 | + description: sdk-go ref to check ("latest" for latest release tag) |
| 18 | + required: true |
| 19 | + default: latest |
| 20 | + api_ref: |
| 21 | + description: api-go ref to check |
| 22 | + required: true |
| 23 | + default: master |
| 24 | + |
| 25 | +jobs: |
| 26 | + check-sdk-go-compatibility: |
| 27 | + name: "Check sdk-go compatibility" |
| 28 | + runs-on: ubuntu-latest |
| 29 | + |
| 30 | + steps: |
| 31 | + - name: Validate inputs |
| 32 | + id: inputs |
| 33 | + env: |
| 34 | + GH_TOKEN: ${{ github.token }} |
| 35 | + SDK_REF: ${{ inputs.sdk_ref }} |
| 36 | + API_REF: ${{ inputs.api_ref }} |
| 37 | + run: | |
| 38 | + if [[ "$SDK_REF" == "latest" ]]; then |
| 39 | + SDK_REF=$(gh api /repos/temporalio/sdk-go/releases/latest --jq '.name') |
| 40 | + fi |
| 41 | + echo "SDK_REF=$SDK_REF" | tee -a "$GITHUB_OUTPUT" |
| 42 | + echo "API_REF=$API_REF" | tee -a "$GITHUB_OUTPUT" |
| 43 | +
|
| 44 | + - name: Checkout |
| 45 | + uses: actions/checkout@v4 |
| 46 | + with: |
| 47 | + repository: temporalio/sdk-go |
| 48 | + ref: ${{ steps.inputs.outputs.SDK_REF }} |
| 49 | + |
| 50 | + - name: Setup Go |
| 51 | + uses: actions/setup-go@v5 |
| 52 | + with: |
| 53 | + go-version: stable |
| 54 | + |
| 55 | + - name: Update api-go |
| 56 | + env: |
| 57 | + API_REF: ${{ steps.inputs.outputs.API_REF }} |
| 58 | + run: | |
| 59 | + for f in $(find . -iname go.mod); do |
| 60 | + cd $(dirname $f) |
| 61 | + go get go.temporal.io/api@$API_REF |
| 62 | + go mod tidy |
| 63 | + cd - |
| 64 | + done |
| 65 | +
|
| 66 | + - name: Run check |
| 67 | + run: go run . check |
| 68 | + working-directory: ./internal/cmd/build |
| 69 | + |
| 70 | + - name: Run unit test |
| 71 | + run: go run . unit-test |
| 72 | + working-directory: ./internal/cmd/build |
| 73 | + |
| 74 | + - name: Run integration tests |
| 75 | + continue-on-error: true |
| 76 | + run: go run . integration-test -dev-server |
| 77 | + working-directory: ./internal/cmd/build |
0 commit comments