1616 - name : Checkout code
1717 uses : actions/checkout@v3
1818
19+ - name : Initialize submodules
20+ env :
21+ GIT_ASKPASS : /bin/echo
22+ GH_PAT : ${{ secrets.GH_PAT }}
23+ run : |
24+ git config --global url."https://${GH_PAT}@github.com/".insteadOf "https://github.com/"
25+ git submodule update --init --recursive
26+
1927 - name : Install uv
2028 uses : astral-sh/setup-uv@v6
2129 with :
@@ -29,18 +37,43 @@ jobs:
2937
3038 - name : Ensure no differences in generated code
3139 run : |
32- cp -r src/athena_client/generated src/athena_client/generated_backup
33- ./scripts/compile_proto.sh
34- diff -r src/athena_client/generated src/athena_client/generated_backup || (echo "Generated code differs. Please commit the changes after running compile_proto.sh." && exit 1)
40+ source .venv/bin/activate
41+ GENERATED_DIR="src/athena_client/generated"
42+ BACKUP_DIR="src/athena_client/generated_backup"
43+
44+ cp -r $GENERATED_DIR $BACKUP_DIR
45+
46+ ./scripts/compile_proto.sh || (echo "Protobuf compilation failed. Ensure submodules are initialized and the proto file exists." && exit 1)
47+
48+ # Fix imports in generated files
49+ if [[ -f "$GENERATED_DIR/athena/athena_pb2_grpc.py" && -f "$GENERATED_DIR/athena/athena_pb2.py" ]]; then
50+ sed -i "$GENERATED_DIR/athena/athena_pb2_grpc.py" -e 's/^from athena /from athena_client.generated.athena /'
51+ sed -i "$GENERATED_DIR/athena/athena_pb2.py" -e 's/^from athena /from athena_client.generated.athena /'
52+ else
53+ echo "Error: Expected files not found in $GENERATED_DIR/athena"
54+ exit 1
55+ fi
56+
57+ diff -r $GENERATED_DIR $BACKUP_DIR || (echo "Generated code differs. Please commit the changes after running compile_proto.sh." && exit 1)
58+
59+ rm -rf $BACKUP_DIR
3560
3661 - name : Run linter
3762 run : |
3863 uv run ruff check
3964
65+ - name : Run code formatting check
66+ run : |
67+ uv run ruff format --check
68+
4069 - name : Run type checking
4170 run : |
4271 uv run pyright
4372
4473 - name : Run tests
4574 run : |
4675 uv run pytest
76+
77+ - name : Build package
78+ run : |
79+ uv build
0 commit comments