Skip to content

Commit 1631da0

Browse files
authored
[Python Client] CI for Python client (Continue PR#1096) (#1639)
Adds CI for python client. It does not include caching poetry step for now since we do not have poetry.lock (it is in .gitignore), see relevant discussion in: #1102 (comment), #1096 (comment), we can add that later
1 parent af26732 commit 1631da0

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
# This workflow uses actions that are not certified by GitHub.
21+
# They are provided by a third-party and are governed by
22+
# separate terms of service, privacy policy, and support
23+
# documentation.
24+
# This workflow will build a Python project with Poetry and cache/restore any dependencies to improve the workflow execution time
25+
# For more information see: https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-python
26+
27+
name: Python Client CI
28+
29+
on:
30+
push:
31+
branches: [ "main" ]
32+
pull_request:
33+
branches: [ "main" ]
34+
35+
jobs:
36+
build:
37+
38+
runs-on: ubuntu-latest
39+
strategy:
40+
matrix:
41+
python-version: ["3.9", "3.10", "3.11"]
42+
43+
steps:
44+
- name: Checkout Polaris project
45+
uses: actions/checkout@v4
46+
47+
- name: Set up Python ${{ matrix.python-version }}
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: ${{ matrix.python-version }}
51+
52+
- name: Install Poetry
53+
run: |
54+
pip install --user --upgrade -r regtests/requirements.txt
55+
56+
# TODO: add cache for poetry dependencies once we have poetry.lock in the repo
57+
- name: Install dependencies
58+
working-directory: client/python
59+
run: poetry install --all-extras
60+
61+
- name: Lint with flake8
62+
working-directory: client/python
63+
run: |
64+
poetry run flake8 --select=E9,F63,F7,F82 --max-line-length=127 --statistics
65+
66+
- name: Test with pytest
67+
working-directory: client/python
68+
run: |
69+
export SCRIPT_DIR="non-existing-mock-directory"
70+
poetry run pytest

0 commit comments

Comments
 (0)