Merge pull request #1 from warpstreamlabs/cupcicm/pr/1 #3
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
| name: validate definitions | |
| on: | |
| push: | |
| branches: ["master"] | |
| paths: | |
| - 'generate/**' | |
| pull_request: | |
| branches: ["*"] | |
| paths: | |
| - 'generate/**' | |
| concurrency: | |
| group: validate-definitions-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| validate-definitions: | |
| if: github.repository == 'twmb/franz-go' | |
| runs-on: ubuntu-latest | |
| name: "validate DSL against Kafka JSON" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: 'stable' | |
| - name: Find latest Kafka release tag | |
| id: kafka-version | |
| run: | | |
| TAG=$(git ls-remote --tags https://github.com/apache/kafka.git \ | |
| | sed -n 's|.*refs/tags/\([0-9]*\.[0-9]*\.[0-9]*\)$|\1|p' \ | |
| | sort -V | tail -1) | |
| echo "Using Kafka $TAG" | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: apache/kafka | |
| ref: ${{ steps.kafka-version.outputs.tag }} | |
| path: kafka | |
| sparse-checkout: clients/src/main/resources/common/message | |
| - run: cd generate && go test -run TestValidateDSLAgainstKafkaJSON -v | |
| env: | |
| KAFKA_DIR: ${{ github.workspace }}/kafka |