Skip to content

Commit 03683c1

Browse files
committed
update
1 parent 16ccc16 commit 03683c1

4 files changed

Lines changed: 17 additions & 74 deletions

File tree

.github/workflows/build_deploy_dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ jobs:
126126
deploy-env: ${{ matrix.deploy-env }}
127127
secrets: inherit
128128

129+
# This is a collection point for all of the matrix tests above so we can have a single required job
129130
tests_completed:
130131
name: All Tests Succeeded
131132
needs: [run_unit_tests, run_integration_tests, changes]

.github/workflows/build_deploy_prod.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ jobs:
4545
- name: Setup uv
4646
uses: astral-sh/setup-uv@v5
4747
with:
48-
# Place cache in the tool dir because we mount this in our runnners
49-
cache-local-path: "/home/runner/_work/_tool/uv-local-cache"
50-
prune-cache: false
51-
python-version: ${{ vars.CI_PYTHON_VERSION || '3.10' }}
48+
cache-local-path: "/home/runner/_work/_tool/uv-local-cache" # Place cache in the tool dir because we mount this in our runnners
49+
prune-cache: false # We want to save all cache because it's in the mount^
50+
python-version: ${{ vars.CI_PYTHON_VERSION || '3.11' }} # Default to 3.11 where vars aren't available (PRs from forks)
5251
- name: Install dependencies
5352
run: |
5453
uv pip install -r requirements/requirements-dev.txt

.github/workflows/tests_integration.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,13 @@ env:
3737
UV_LINK_MODE: "symlink"
3838

3939
jobs:
40-
changes:
41-
name: Filter changed files
42-
runs-on: mdb-dev
43-
outputs:
44-
not-docs: ${{ steps.filter.outputs.not-docs }}
45-
steps:
46-
- uses: actions/checkout@v4
47-
- uses: dorny/paths-filter@v3
48-
id: filter
49-
with:
50-
predicate-quantifier: "every"
51-
filters: |
52-
not-docs:
53-
- '!docs/**'
54-
- '!**/*.md'
55-
- '!.github/workflows/build_deploy_dev.yml'
56-
- '!.github/workflows/test_on_deploy.yml'
57-
- '!mindsdb/__about__.py'
5840
# Run our integration tests
5941
test:
60-
needs: changes
6142
environment:
6243
name: ${{ inputs.deploy-env }}
6344
url: ${{ vars.MDB_ENV_URL }}
6445
name: Run integration tests on deploy
6546
runs-on: mdb-dev
66-
if: ${{ github.ref_type == 'branch' && needs.changes.outputs.not-docs == 'true' }}
6747
steps:
6848
- uses: actions/checkout@v4
6949
with:

.github/workflows/tests_unit.yml

Lines changed: 13 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -83,7 +71,7 @@ jobs:
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

Comments
 (0)