@@ -25,56 +25,44 @@ jobs:
2525 code_checking :
2626 name : Run static code checks
2727 runs-on : mdb-dev
28- needs : changes
2928 steps :
3029 - name : Checkout
31- if : ${{ needs.changes.outputs.not-docs == 'true' }}
3230 uses : actions/checkout@v4
3331 with :
34- # required to grab the history of the PR for pre-commit to work out what's changed
35- fetch-depth : 0
36- ref : ${{ github.event.pull_request.head.sha }} # Always check out the PR branch
37- # Install python and setup UV
32+ fetch-depth : 0 # required to grab the history of the PR so pre-commit can work out what's changed
33+ ref : ${{ github.event.pull_request.head.sha }}
3834 - name : Setup uv
39- if : ${{ needs.changes.outputs.not-docs == 'true' }}
4035 uses : astral-sh/setup-uv@v5
4136 with :
42- # Place cache in the tool dir because we mount this in our runnners
43- cache-local-path : " /home/runner/_work/_tool/uv-local-cache"
44- prune-cache : false
45- # I can't work out how to use vars.CI_PYTHON_VERSION for forks here in a nice way, so we have to hardcode it for forks
46- python-version : ${{ vars.CI_PYTHON_VERSION || '3.10' }}
37+ cache-local-path : " /home/runner/_work/_tool/uv-local-cache" # Place cache in the tool dir because we mount this in our runnners
38+ prune-cache : false # We want to save all cache because it's in the mount^
39+ python-version : ${{ vars.CI_PYTHON_VERSION || '3.11' }} # Default to 3.11 where vars aren't available (PRs from forks)
4740
4841 # Checks the codebase for print() statements and fails if any are found
4942 # We should be using loggers instead
5043 - name : Check for print statements
51- if : ${{ needs.changes.outputs.not-docs == 'true' }}
5244 run : |
5345 # The pyproject file confuses uv: https://github.com/astral-sh/uv/issues/6838
5446 rm pyproject.toml
5547 uv run tests/scripts/check_print_statements.py
5648
5749 - name : Install MDB dev requirements
58- if : ${{ needs.changes.outputs.not-docs == 'true' }}
5950 run : |
6051 uv pip install -r requirements/requirements-dev.txt
6152
6253 # Run pre-commit on all changed files
6354 # See .pre-commit-config.yaml for the list of checks
6455 - name : Run pre-commit
65- if : ${{ needs.changes.outputs.not-docs == 'true' }}
6656 run : |
6757 pre-commit run --show-diff-on-failure --color=always --from-ref ${{ github.event.pull_request.base.sha || 'HEAD~1' }} --to-ref ${{ github.event.pull_request.head.sha || 'HEAD' }}
6858
6959 # Runs a few different checks against our many requirements files
7060 # to make sure they're in order
7161 - name : Check requirements files
72- if : ${{ needs.changes.outputs.not-docs == 'true' }}
7362 run : |
7463 uv run tests/scripts/check_requirements.py
7564
7665 # Creates a matrix of environments to test against using matrix_includes.json
77- # Used for installation checks below
7866 matrix_prep :
7967 name : Prepare matrix
8068 runs-on : mdb-dev
8371 steps :
8472 - uses : actions/checkout@v4
8573 with :
86- ref : ${{ github.event.pull_request.head.sha }} # Always check out the PR branch
74+ ref : ${{ github.event.pull_request.head.sha }}
8775 - id : set-matrix
8876 uses : JoshuaTheMiller/conditional-build-matrix@v2.0.1
8977 with :
@@ -92,25 +80,21 @@ jobs:
9280 # Check that our pip package is able to be installed in all of our supported environments
9381 check_install :
9482 name : Check pip installation
95- needs : [changes, matrix_prep, code_checking]
83+ needs : [matrix_prep, code_checking]
9684 strategy :
9785 matrix : ${{fromJson(needs.matrix_prep.outputs.matrix)}}
9886 runs-on : ${{ matrix.runs_on }}
9987 steps :
10088 - name : Checkout
101- if : ${{ needs.changes.outputs.not-docs == 'true' }}
10289 uses : actions/checkout@v4
10390 with :
104- ref : ${{ github.event.pull_request.head.sha }} # Always check out the PR branch
105- # Install python and setup UV
91+ ref : ${{ github.event.pull_request.head.sha }}
10692 - name : Setup uv
107- if : ${{ needs.changes.outputs.not-docs == 'true' }}
10893 uses : astral-sh/setup-uv@v5
10994 with :
11095 enable-cache : true
11196 python-version : ${{ matrix.python-version }}
11297 - name : Check pip package builds and installs
113- if : ${{ needs.changes.outputs.not-docs == 'true' }}
11498 run : |
11599 # Install dev requirements and build our pip package
116100 uv pip install -r requirements/requirements-dev.txt
@@ -123,31 +107,25 @@ jobs:
123107
124108 unit_tests :
125109 name : Run Unit Tests
126- needs : [changes, matrix_prep, code_checking]
110+ needs : [matrix_prep, code_checking]
127111 strategy :
128112 matrix : ${{fromJson(needs.matrix_prep.outputs.matrix)}}
129113 runs-on : ${{ matrix.runs_on }}
130- if : github.ref_type == 'branch'
131114 steps :
132115 - name : Checkout
133- if : ${{ needs.changes.outputs.not-docs == 'true' }}
134116 uses : actions/checkout@v4
135117 with :
136- ref : ${{ github.event.pull_request.head.sha }} # Always check out the PR branch
137- # Install python and setup UV
118+ ref : ${{ github.event.pull_request.head.sha }}
138119 - name : Setup uv
139- if : ${{ needs.changes.outputs.not-docs == 'true' }}
140120 uses : astral-sh/setup-uv@v5
141121 with :
142122 enable-cache : true
143123 python-version : ${{ matrix.python-version }}
144- version : " 0.7.19"
145124 - name : Install dependencies
146- if : ${{ needs.changes.outputs.not-docs == 'true' }}
147125 run : |
148- uv pip install -r requirements/requirements-test.txt
149126 # TODO: for now some tests rely on lightwood
150127 uv pip install . \
128+ -r requirements/requirements-test.txt \
151129 .[lightwood] \
152130 .[clickhouse] \
153131 .[snowflake] \
@@ -161,26 +139,11 @@ jobs:
161139 .[ms_teams] \
162140 .[salesforce] \
163141 .[mysql] \
164- .[chromadb]
142+ .[chromadb] \
143+ .[mssql]
165144 uv pip freeze
166145 git clone --branch v$(uv pip show mindsdb_sql_parser | grep Version | cut -d ' ' -f 2) https://github.com/mindsdb/mindsdb_sql_parser.git parser_tests
167- - name : Install mssql dependencies
168- if : ${{ needs.changes.outputs.not-docs == 'true' }}
169- run : |
170- # Set FreeTDS build flags only on macOS
171- # Currently broken due to new cython version, see https://github.com/pymssql/pymssql/issues/937
172- if [[ "$RUNNER_OS" == "macOS" ]]; then
173- echo "Skipping pymssql build on macOS temporarily"
174- # brew install freetds
175- # echo "Setting FreeTDS flags for macOS pymssql build"
176- # export LDFLAGS="-L$(brew --prefix freetds)/lib"
177- # export CFLAGS="-I$(brew --prefix freetds)/include"
178- # uv pip install pymssql==2.3.1 --no-binary :all:
179- else
180- uv pip install .[mssql]
181- fi
182146
183147 - name : Run unit tests
184- if : ${{ needs.changes.outputs.not-docs == 'true' }}
185148 run : |
186149 make unit_tests_slow
0 commit comments