@@ -76,19 +76,11 @@ jobs:
7676 - name : Checkout code
7777 uses : actions/checkout@v4.1.0
7878
79- - name : Cache Python deps
80- uses : actions/cache@v3
81- if : ${{ github.event_name == 'pull_request' || inputs.use-cache }}
82- with :
83- path : python-client/.venv
84- key : ${{ matrix.os }}-${{ matrix.python-version }}-python-deps-${{ hashFiles('python-client/tests/fixtures/**/*py')}}
85- restore-keys : ${{ matrix.os }}-${{ matrix.python-version }}-python-deps
86-
8779 - name : Setup PDM
8880 uses : pdm-project/setup-pdm@v3
8981 with :
9082 python-version : ${{ matrix.python-version }}
91- cache : false # TODO(Bazire): https://linear.app/giskard/issue/GSK-1712/activate-cache-on-pdm-setup-in-github-action
83+ cache : true
9284
9385 - name : Set up Pandoc (needed for python-client doc)
9486 uses : r-lib/actions/setup-pandoc@v2
@@ -104,50 +96,42 @@ jobs:
10496 restore-keys : ${{ matrix.os }}-${{ matrix.python-version }}-python-giskard-test-resources
10597
10698 - name : Install dependencies
107- working-directory : python-client
10899 run : pdm install -G :all
109100
110101 - name : Lint code
111- working-directory : python-client
112102 run : pdm run lint
113103
114104 - name : Install pydantic v2
115105 if : ${{ matrix.pydantic_v2 }}
116- working-directory : python-client
117106 run : |
118107 pdm run pip uninstall pydantic pydantic_core -y
119108 pdm run pip install "pydantic>=2<3"
120109
121110 - name : Check Pydantic installed version
122- working-directory : python-client
123111 run : |
124112 pdm run pip freeze | grep '^pydantic'
125113 pdm run pip freeze | grep -q '^pydantic==${{ matrix.pydantic_v2 && '2' || '1' }}\.'
126114
127115 - name : Test code
128- working-directory : python-client
129116 env :
130117 PYTEST_XDIST_AUTO_NUM_WORKERS : ${{ startsWith(matrix.os,'windows-') && 1 || 2 }}
131118 run : pdm run test-fast
132119
133120 - name : Build doc
134121 if : ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'}}
135- working-directory : python-client
136122 run : pdm run doc
137123
138124 - name : Build
139- working-directory : python-client
140125 run : pdm build
141126
142127 - name : " Python client: archive built artifacts"
143128 if : ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' }}
144129 uses : actions/upload-artifact@v3
145130 with :
146- path : python-client/ dist/*whl
131+ path : dist/*whl
147132
148133 - name : Run integration tests for python
149134 if : ${{ inputs.run-integration-tests && matrix.os != 'windows-2019' }}
150- working-directory : python-client
151135 env :
152136 PYTEST_XDIST_AUTO_NUM_WORKERS : 2
153137 run : pdm run test -m 'slow'
0 commit comments