Skip to content

test(scope): dummy

test(scope): dummy #35

Workflow file for this run

name: Thrift Syntax Validation
on: [push, pull_request]
jobs:
validate-thrift:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Pull Thrift Docker image
run: docker pull apache/thrift:latest
- name: Validate Thrift Files via Docker
run: |
# Initialize error flag
ERROR_FOUND=0
# Find all thrift files and validate them
while IFS= read -r -d '' thrift_file; do
echo "Validating $thrift_file..."
if ! docker run --rm -v "$PWD:/data" --entrypoint sh apache/thrift:latest \
-c "mkdir -p /data/gen && thrift --gen xml -I /data/include -out /data/gen /data/$thrift_file" 2>&1; then
echo "Error in file: $thrift_file"
ERROR_FOUND=1
fi
done < <(find ./idl -name '*.thrift' -print0)
# Exit with appropriate status
if [ $ERROR_FOUND -eq 1 ]; then
echo "Thrift validation failed. Please check the errors above."
exit 1
else
echo "All Thrift files validated successfully!"
exit 0
fi