Skip to content
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d6cd758
refactor conda build for cpp tests
Mar 19, 2026
3f3b982
separate compile-and-test logic into separete file
markovskipetar Mar 19, 2026
3a0f2ea
Fix ternary shell thing
markovskipetar Mar 19, 2026
0a7769d
fix incorrect 'inputs' sytnax
markovskipetar Mar 19, 2026
2cd5b55
fix missing kvp's for build artifacts
markovskipetar Mar 19, 2026
eab8513
change workflow file name
markovskipetar Mar 20, 2026
d19f5f4
add 'dev' to HYPOTHESIS_PROFILE for python_tests
markovskipetar Mar 20, 2026
29f306f
fix regex for azure installing on win
markovskipetar Mar 20, 2026
e5eacf9
change if logic in azure installation for win
markovskipetar Mar 20, 2026
17cc06f
remove ' || true ' from run_cpp_test
markovskipetar Mar 20, 2026
f4e77b4
add missing comment for checkout step
markovskipetar Mar 20, 2026
7fdf75b
add missing text from comment
markovskipetar Mar 20, 2026
881c535
Remove redundant Clear CMAKE_GENERATOR variables
markovskipetar Mar 20, 2026
8df8997
separte 'build_with_conda_and_test.yml' to '..._win.yml' and '..._uni…
markovskipetar Mar 23, 2026
c8089c4
fix: handle null boolean inputs for non-dispatch trigger events
markovskipetar Mar 23, 2026
a9af48b
fix null string handling
markovskipetar Mar 23, 2026
9c4caca
remove ' || false ' from run_cpp_tests
markovskipetar Mar 23, 2026
09f1949
add " != false " to run cpp tests
markovskipetar Mar 23, 2026
00c2c88
add debug log for investigating why cpp tests are skipped
markovskipetar Mar 23, 2026
a749297
rename run_cpp_test to disable_cpp_tests
markovskipetar Mar 23, 2026
185d094
Refactor workflow parameters
Mar 24, 2026
d9db523
Remove unused code
Mar 24, 2026
9eb26a1
Fix Win 'cache-environment-key' value
Mar 24, 2026
1126624
add debug
Mar 24, 2026
1e39cc8
add protoc to else
Mar 24, 2026
b8bd15b
revert files
Mar 24, 2026
212d869
Change 'runner' to 'os'
Mar 25, 2026
928a663
Add comments to CMAKE_GENERATOR_PLATFORM and CMAKE_GENERATOR_TOOLSET
Mar 25, 2026
4ab5335
refactor if statements
Mar 25, 2026
cb551af
Add comments to checkout
Mar 25, 2026
32ad2de
Add read permission to win and unix scripts
Mar 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,292 changes: 68 additions & 1,224 deletions .github/workflows/build_with_conda.yml

Large diffs are not rendered by default.

308 changes: 308 additions & 0 deletions .github/workflows/compile_and_test_with_conda_unix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,308 @@
name: Conda Build and Test (Unix)
on:
workflow_call:
inputs:
runner: {required: true, type: string, description: GitHub runner to execute on}
platform: {required: true, type: string, description: Platform identifier e.g. linux_64 or osx_arm64}
preset: {required: true, type: string, description: CMake preset name e.g. linux-conda-release}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cpp_tests_enabled input is declared but never set to false by any caller, making it a no-op guard.

No call site in build_with_conda.yml passes cpp_tests_enabled: false. The default is true, so the inputs.cpp_tests_enabled condition in the cpp_tests job if: block (line 93) is always true and never suppresses anything. Either:

  • Remove cpp_tests_enabled and rely solely on run_cpp_tests, or
  • Document which platforms should pass cpp_tests_enabled: false (e.g., Windows) and wire it up at the call sites.

This is a different input from run_cpp_tests — the distinction between "user requested to disable" vs "platform doesn't support it" is valid, but callers need to actually use it.

free_disk_space: {required: false, type: boolean, default: true, description: Free disk space before build. Linux only}
install_mongodb: {required: false, type: boolean, default: true, description: Install MongoDB for tests. Linux only}
run_cpp_tests: {required: false, type: boolean, default: true, description: Whether to run C++ tests}
hypothesis_profile: {required: false, type: string, default: '', description: Hypothesis profile e.g. ci_linux or ci_macos}

persistent_storage: {required: false, type: string, default: 'no', description: Persistent storage type}
debug_enabled: {required: false, type: boolean, default: false, description: Enable tmate debug session}
run_enable_logging: {required: false, type: boolean, default: false, description: Enable ArcticDB debug logging}
run_commandline: {required: false, type: string, default: '', description: Custom commandline to run before tests}
run_custom_pytest_command: {required: false, type: string, default: '', description: Custom pytest command or additional arguments}

jobs:
# ==================== JOB 1: COMPILE ====================
compile:
name: Compile (${{inputs.platform}})
if: |
always() &&
!cancelled()
runs-on: ${{inputs.runner}}
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
SCCACHE_GHA_VERSION: ${{vars.SCCACHE_GHA_VERSION || 1}}
SCCACHE_GHA_ENABLED: "true"
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v6.0.1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add back missing comment (applies to all checkout actions):

  - uses: actions/checkout@v6.0.1
        # Do not use recursive submodules checkout to simulate conda feedstock build
        # with:
        #   submodules: recursive

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bring back missing comment, applies to all of the checkout steps


- name: Configure sccache
uses: mozilla-actions/sccache-action@v0.0.9
with:
version: v0.12.0
disable_annotations: 'true'

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2.0.0
id: cpu-cores

- name: Install Conda environment from environment-dev.yml
uses: mamba-org/setup-micromamba@v2.0.6
with:
environment-file: environment-dev.yml
environment-name: arcticdb
init-shell: bash
cache-environment: true
cache-environment-key: conda-env-${{inputs.platform}}
post-cleanup: 'none'

- name: Build ArcticDB with conda
run: |
python -m pip install --no-build-isolation --no-deps --retries 3 --timeout 400 -v -e .
env:
ARCTICDB_USING_CONDA: 1
ARCTICDB_BUILD_CPP_TESTS: 1

- name: Show sccache stats
run: ${SCCACHE_PATH} --show-stats || sccache --show-stats

- name: Archive build artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: build-${{inputs.platform}}
retention-days: 7
path: |
cpp/out/${{inputs.preset}}-build/
python/arcticdb_ext*
python/**/*.so

# ==================== JOB 2: C++ TESTS ====================
cpp_tests:
Comment thread Fixed
Comment thread Fixed
Comment thread Fixed
name: C++ Tests (${{inputs.platform}})
needs: [compile]
if: |
always() &&
!cancelled() &&
inputs.run_cpp_tests
runs-on: ${{inputs.runner}}
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
SCCACHE_GHA_VERSION: ${{vars.SCCACHE_GHA_VERSION || 1}}
SCCACHE_GHA_ENABLED: "true"
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v6.0.1

- name: Configure sccache
uses: mozilla-actions/sccache-action@v0.0.9
with:
version: v0.12.0
disable_annotations: 'true'

- name: Free Disk Space
if: inputs.free_disk_space
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: false
large-packages: false
docker-images: false

- name: Download build artifacts
uses: actions/download-artifact@v8
with:
name: build-${{inputs.platform}}
path: .

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2.0.0
id: cpu-cores

- name: Install Conda environment from environment-dev.yml
uses: mamba-org/setup-micromamba@v2.0.6
with:
environment-file: environment-dev.yml
environment-name: arcticdb
init-shell: bash
cache-environment: true
cache-environment-key: conda-env-${{inputs.platform}}
post-cleanup: 'none'

- name: Configure C++ Tests
run: |
cd cpp
if [ -f out/${{inputs.preset}}-build/CMakeCache.txt ] && grep -q "TEST:BOOL=ON" out/${{inputs.preset}}-build/CMakeCache.txt; then
echo "CMake cache already has TEST=ON, skipping reconfiguration"
else
cmake --preset ${{inputs.preset}} -DTEST=ON
fi
env:
ARCTICDB_USING_CONDA: 1

- name: Build C++ Tests
run: |
cd cpp
cmake --build --preset ${{inputs.preset}} --target arcticdb_rapidcheck_tests -j ${{ steps.cpu-cores.outputs.count }}
cmake --build --preset ${{inputs.preset}} --target test_unit_arcticdb -j ${{ steps.cpu-cores.outputs.count }}
env:
ARCTICDB_USING_CONDA: 1

- name: Show sccache stats
run: ${SCCACHE_PATH} --show-stats || sccache --show-stats

- name: Run C++ Tests
run: |
cd cpp/out/${{inputs.preset}}-build/
ctest --output-on-failure
env:
ARCTICDB_USING_CONDA: 1

# ==================== JOB 3: PYTHON TESTS ====================
python_tests:
Comment thread Fixed
Comment thread Fixed
name: Python Tests (${{inputs.platform}}) - ${{matrix.type}}
needs: [compile]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The python_tests job uses if: always() && !cancelled() which means it will proceed even when the upstream compile job failed (status failure). This wastes runner time attempting to download artifacts that were never uploaded.

The compile job itself uses if: always() && !cancelled(), so a failure there won't be cancelled — it will be failure. The condition should guard against a failed compile:

Suggested change
needs: [compile]
if: |
always() &&
!cancelled() &&
needs.compile.result == 'success'

if: |
always() &&
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: python_tests will run even when compile fails, wasting runner time.

if: always() && !cancelled() overrides the needs: [compile] dependency and causes the job to run regardless of whether compile succeeded or failed. When compile fails, artifact download will fail and all 6 matrix jobs will be wasted.

Add a compile-success guard:

Suggested change
always() &&
if: |
always() &&
!cancelled() &&
needs.compile.result == 'success'

!cancelled()
runs-on: ${{inputs.runner}}
strategy:
fail-fast: false
matrix:
type: [unit, integration, hypothesis, stress, compat, enduser]
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
SCCACHE_GHA_VERSION: ${{vars.SCCACHE_GHA_VERSION || 1}}
SCCACHE_GHA_ENABLED: "true"
defaults:
run:
shell: bash -l {0}
steps:
- name: Free Disk Space
if: inputs.free_disk_space
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: false
large-packages: false
docker-images: false

- uses: actions/checkout@v6.0.1

- name: Configure sccache
uses: mozilla-actions/sccache-action@v0.0.9
with:
version: v0.12.0
disable_annotations: 'true'

- name: Download build artifacts
uses: actions/download-artifact@v8
with:
name: build-${{inputs.platform}}
path: .

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2.0.0
id: cpu-cores

- name: Print cache key
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug step should be removed before merge.

This step echoes the cache key on every CI run and adds noise to logs. The cache key (conda-env-${{ inputs.platform }}) is already visible in the setup-micromamba step output and in the workflow inputs. G-D-Petrov flagged the same pattern on the earlier "Debug inputs" step (#39).

Suggested change
- name: Print cache key

run: |
echo "Cache key: conda-env-${{inputs.platform}}"

- name: Install Conda environment from environment-dev.yml
uses: mamba-org/setup-micromamba@v2.0.6
with:
environment-file: environment-dev.yml
environment-name: arcticdb
init-shell: bash
cache-environment: true
cache-environment-key: conda-env-${{inputs.platform}}
post-cleanup: 'none'

- name: Install ArcticDB from artifacts
run: |
if [ -d "cpp/out/${{inputs.preset}}-build" ] && (ls python/arcticdb_ext*.so 2>/dev/null | head -1 | grep -q .); then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Artifact detection for macOS may fail silently if *.so glob matches nothing.

The check ls python/arcticdb_ext*.so 2>/dev/null | head -1 | grep -q . relies on the .so extension. On macOS conda builds the extension is .so (not .dylib), so this should work. However, if the artifact download placed files in a subdirectory rather than directly under python/, this check will fail and the ARCTIC_CMAKE_PRESET=skip optimisation will be bypassed, causing a full (slow) rebuild. Consider adding a fallback:

Suggested change
if [ -d "cpp/out/${{inputs.preset}}-build" ] && (ls python/arcticdb_ext*.so 2>/dev/null | head -1 | grep -q .); then
if [ -d "cpp/out/${{inputs.preset}}-build" ] && (ls python/arcticdb_ext*.so python/arcticdb_ext*.pyd 2>/dev/null | head -1 | grep -q .); then

echo "Build artifacts found, skipping CMake build"
export ARCTIC_CMAKE_PRESET=skip
fi
python -m pip install --no-build-isolation --no-deps --retries 3 --timeout 400 -v -e .
env:
ARCTICDB_USING_CONDA: 1

- name: Install MongoDB
if: inputs.install_mongodb && !contains(inputs.platform, 'aarch64')
uses: ./.github/actions/install_mongodb

- name: Install MongoDB (ARM manual)
if: inputs.install_mongodb && contains(inputs.platform, 'aarch64')
run: |
curl --retry 5 --retry-delay 5 --retry-connrefused -LO https://fastdl.mongodb.org/linux/mongodb-linux-aarch64-ubuntu2204-7.0.0.tgz
tar -xzf mongodb-linux-aarch64-ubuntu2204-7.0.0.tgz
cp mongodb-linux-aarch64-ubuntu2204-7.0.0/bin/* /usr/local/bin/
mongod --version
rm -rf mongodb-linux-aarch64-ubuntu2204-7.0.0.tgz mongodb-linux-aarch64-ubuntu2204-7.0.0

- name: Install npm
uses: actions/setup-node@v6.1.0
with:
node-version: '24'

- name: Install Azurite
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: npm install -g azurite

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: broken sed regex — Windows drive-letter path conversion silently fails.

s|^$[A-Z]$:|/\1| does not capture the drive letter. $[A-Z] matches a literal $ followed by an uppercase letter, and \1 refers to a non-existent capture group. The original code in the monolithic workflow used \([A-Z]\) (BRE capture group):

Suggested change
npm_bin_dir=$(echo "$npm_bin_dir" | sed 's|^\([A-Z]\):|/\1|' | tr '[:upper:]' '[:lower:]' | sed 's|\\|/|g')

- name: Check no arcticdb file depend on tests package
run: build_tooling/checks.sh

- name: Set persistent storage variables
if: inputs.persistent_storage != 'no'
uses: ./.github/actions/set_persistent_storage_env_vars
with:
aws_access_key: "${{ secrets.AWS_S3_ACCESS_KEY }}"
aws_secret_key: "${{ secrets.AWS_S3_SECRET_KEY }}"
gcp_access_key: "${{ secrets.GCP_S3_ACCESS_KEY }}"
gcp_secret_key: "${{ secrets.GCP_S3_SECRET_KEY }}"
azure_container: "githubblob"
azure_connection_string: "${{ secrets.AZURE_CONNECTION_STRING }}"
persistent_storage: ${{inputs.persistent_storage}}

- name: Set ArcticDB Debug Logging
if: inputs.run_enable_logging
uses: ./.github/actions/enable_logging

- name: Setup tmate session
if: inputs.debug_enabled
uses: mxschmitt/action-tmate@v3

- name: Install pytest-repeat
run: python -m pip --retries 3 --timeout 180 install pytest-repeat

- name: Test with pytest
run: |
openssl version -d || true
ulimit -a || true
echo "Run commandline: $COMMANDLINE"
eval "$COMMANDLINE"
export ARCTICDB_WARN_ON_WRITING_EMPTY_DATAFRAME=0
if [[ "$(echo "$ARCTICDB_PYTEST_ARGS" | xargs)" == pytest* ]]; then
python -m pip install pytest-repeat setuptools wheel
python setup.py protoc --build-lib python
echo "Run custom pytest command: $ARCTICDB_PYTEST_ARGS"
eval "$ARCTICDB_PYTEST_ARGS"
else
cd python
python -m pytest --timeout=3600 -v --tb=line -n logical --dist worksteal \
tests/${{matrix.type}} $ARCTICDB_PYTEST_ARGS
fi
env:
ARCTICDB_USING_CONDA: 1
COMMANDLINE: ${{inputs.run_commandline}}
CI_MONGO_HOST: ${{inputs.install_mongodb && 'mongodb' || ''}}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: CI_MONGO_HOST: mongodb will not resolve without a Docker service container.

The original python_tests_linux_64 and python_tests_linux_aarch64 jobs used a Docker service container:

services:
  mongodb:
    image: mongo:4.4

This container made MongoDB reachable at the hostname mongodb (Docker's DNS). The new workflow removes the service container entirely and instead installs the MongoDB binary via the install_mongodb action or a manual curl. However, the install_mongodb action only copies the mongod binary to /usr/local/bin — it does not start a mongod daemon, and the hostname mongodb will not resolve without Docker networking.

As a result, tests requiring MongoDB will fail to connect. Options:

  1. Add a step to start mongod locally and set CI_MONGO_HOST: localhost.
  2. Restore the service container via a services: block (not directly possible in reusable workflow_call workflows without workarounds).
  3. Start mongod in the background as part of the install step and update CI_MONGO_HOST accordingly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: CI_MONGO_HOST: mongodb will not resolve — no Docker service container is defined.

The original python_tests_linux_64 and python_tests_linux_aarch64 jobs in the monolithic workflow defined a services.mongodb container that made the hostname mongodb resolvable. This reusable workflow has no services: block, so the hostname mongodb does not exist. Any test that connects to $CI_MONGO_HOST will fail to connect.

MongoDB is installed as a process via ./.github/actions/install_mongodb (or manual download), but that listens on localhost, not mongodb. The env var should be:

Suggested change
CI_MONGO_HOST: ${{inputs.install_mongodb && 'mongodb' || ''}}
CI_MONGO_HOST: ${{inputs.install_mongodb && 'localhost' || ''}}

HYPOTHESIS_PROFILE: ${{inputs.hypothesis_profile || 'dev'}}
ARCTICDB_PYTEST_ARGS: ${{inputs.run_custom_pytest_command}}
STORAGE_TYPE: ${{inputs.persistent_storage == 'no' && 'LMDB' || inputs.persistent_storage}}
NODE_OPTIONS: --openssl-legacy-provider
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline at end of file.

Suggested change
NODE_OPTIONS: --openssl-legacy-provider
NODE_OPTIONS: --openssl-legacy-provider

Comment thread Fixed
Comment thread Fixed
Loading
Loading