RavenDB-27140 Sync Python Embedded with C# #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: tests | |
| on: | |
| push: | |
| branches: [v7.2] | |
| pull_request: | |
| branches: [v7.2] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| # Path A: embedded framework-dependent server -> needs a system .NET. The 7.2 server | |
| # targets net10.0 (7.1 was net8.0), so we install .NET 10 explicitly and assert the | |
| # bundled server really needs it (no more green-by-luck on a preinstalled runtime). | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: "3.13" | |
| - name: Set up .NET 10 | |
| uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1 | |
| with: | |
| dotnet-version: "10.0" | |
| - name: Install package | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| - name: Check formatting (black) | |
| run: | | |
| pip install black | |
| black --check . | |
| # Downloads + unpacks the bundled (framework-dependent) server into | |
| # ravendb_embedded/target/nuget. setuptools is installed explicitly; modern venvs omit it. | |
| - name: Fetch bundled RavenDB server | |
| run: | | |
| pip install setuptools wheel | |
| python setup.py sdist | |
| - name: Assert CI .NET matches the server's required runtime | |
| run: python scripts/check_dotnet_requirement.py | |
| - name: Run tests | |
| run: python -m unittest discover -s tests | |
| - name: Run Lab 01 (embedded zero-config) | |
| run: python labs/01_embedded_zero_config.py | |
| - name: Run Lab 04 (secured embedded) | |
| run: python labs/04_embedded_secured.py | |
| - name: Run Lab 05 (persistent data directory) | |
| run: python labs/05_embedded_persistent.py | |
| external-self-contained: | |
| # Path B: external self-contained server -> runs the native apphost, no system .NET. | |
| # We do not set up .NET; the lab uses a bogus dot_net_path so a successful run proves the | |
| # apphost path is genuinely dotnet-free even though the runner happens to ship a .NET. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: "3.13" | |
| - name: Install package | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| - name: Resolve a self-contained RavenDB server | |
| run: python -c "from ravendb_embedded.on_demand import ensure_server; print(ensure_server(cache_root='server-cache'))" > server-path.txt | |
| - name: Run Lab 02 (self-contained, no system .NET) | |
| run: RAVENDB_SELF_CONTAINED_SERVER="$(cat server-path.txt)" python labs/02_embedded_external_server.py | |
| on-demand: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: "3.13" | |
| - name: Install package | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| - name: Run Lab 03 (on-demand self-contained, no system .NET) | |
| run: python labs/03_on_demand_server.py |