Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 15 additions & 27 deletions .agents/build-and-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,35 @@

Use these commands to verify changes.

## Host Setup

Fresh hosts can install the required toolchain and bootstrap the project with `scripts/setup-windows.ps1`, `scripts/setup-ubuntu.sh`, or `scripts/setup-macos.sh`. Docker installation is opt-in; see `README.md` for the platform-specific invocation.

## Configure

```bash
cmake --preset debug
python3 scripts/dev.py configure
```

The preset uses the in-repo vcpkg submodule at `vcpkg/`. If vcpkg is missing, run:
Use `python` instead of `python3` on Windows. The runner selects `windows-debug` on Windows and `debug` elsewhere. Both presets use the in-repo vcpkg submodule at `vcpkg/`. If vcpkg is missing, run:

```bash
git submodule update --init --recursive
./scripts/bootstrap-vcpkg.sh
python3 scripts/dev.py bootstrap-vcpkg
```

If PostgreSQL/libpq builds fail because `bison` or `flex` is missing, install the system packages and rerun configure.

## Build

```bash
cmake --build --preset debug
```

or:

```bash
make build
python3 scripts/dev.py build
```

## Unit Tests

```bash
ctest --test-dir build/debug --output-on-failure
```

or:

```bash
make test
python3 scripts/dev.py test
```

Tests for middleware should not require a real gRPC server.
Expand All @@ -48,9 +40,9 @@ Tests for middleware should not require a real gRPC server.
Repository integration tests may require PostgreSQL:

```bash
make postgres-up
make migrate
make test
python3 scripts/dev.py postgres-up
python3 scripts/dev.py migrate
python3 scripts/dev.py test
```

Enable integration targets with the relevant CMake option when adding real integration coverage.
Expand All @@ -60,13 +52,7 @@ Enable integration targets with the relevant CMake option when adding real integ
Smoke tests require a running service and may require Docker Compose:

```bash
make smoke
```

Direct command:

```bash
scripts/smoke-grpc.sh
python3 scripts/dev.py smoke
```

## Sanitizers
Expand Down Expand Up @@ -106,3 +92,5 @@ cmake --preset debug

The file is emitted under `build/debug/`.

Visual Studio generators do not emit `compile_commands.json`; use the Ninja `debug` preset from a Visual Studio developer shell when running `clang-tidy` on Windows.

1 change: 1 addition & 0 deletions .agents/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CI should stay readable and close to local developer commands.
- Format check.
- Lint if practical.
- Docker build.
- Windows configure, build, test, and format check.

## Rules

Expand Down
6 changes: 3 additions & 3 deletions .agents/coding-standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ Apply these rules to C++ changes in this repository.
## Formatting And Static Analysis

```bash
make format
make format-check
make lint
python3 scripts/dev.py format
python3 scripts/dev.py format --check
python3 scripts/dev.py lint
```

Run formatting before final verification.
Expand Down
4 changes: 2 additions & 2 deletions .agents/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Docker support is part of the template runtime contract.
## Commands

```bash
make docker-build
python3 scripts/dev.py docker-build
docker compose up
scripts/smoke-grpc.sh
python3 scripts/dev.py smoke
```

12 changes: 8 additions & 4 deletions .agents/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ Follow this workflow for every code change.
Run the normal workflow:

```bash
make format
make build
make test
make verify
python3 scripts/dev.py format
python3 scripts/dev.py build
python3 scripts/dev.py test
python3 scripts/dev.py verify
```

Use `python` instead of `python3` on Windows. The task runner selects the platform's default preset.

Use direct CMake commands when Make is not available:

```bash
Expand All @@ -58,6 +60,8 @@ cmake --build --preset debug
ctest --test-dir build/debug --output-on-failure
```

Use the `windows-debug` configure, build, and test presets with Visual Studio 2022 on Windows.

If tests cannot be run, state exactly why and name the unrun command.

## How To Update Documentation
Expand Down
33 changes: 31 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'vcpkg/.git') }}

- name: Bootstrap vcpkg
run: ./scripts/bootstrap-vcpkg.sh
run: python3 scripts/dev.py bootstrap-vcpkg

- name: Cache CMake build
uses: actions/cache@v4
Expand Down Expand Up @@ -72,7 +72,36 @@ jobs:
run: ctest --preset ci

- name: Format check
run: ./scripts/format.sh --check
run: python3 scripts/dev.py format --check

- name: Docker build
run: docker build -t cpplite:ci .

windows-build-test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Cache vcpkg artifacts
uses: actions/cache@v4
with:
path: |
vcpkg_installed
vcpkg/packages
vcpkg/buildtrees
vcpkg/downloads
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'vcpkg/.git') }}

- name: Configure
run: python scripts/dev.py configure --preset windows-debug

- name: Build
run: python scripts/dev.py build --preset windows-debug -- --parallel 4

- name: Test
run: python scripts/dev.py test --preset windows-debug

- name: Format check
run: python scripts/dev.py format --check
66 changes: 60 additions & 6 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
{
"name": "base",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "23",
Expand All @@ -19,24 +18,30 @@
}
},
{
"name": "debug",
"name": "ninja-base",
"hidden": true,
"inherits": "base",
"generator": "Ninja"
},
{
"name": "debug",
"inherits": "ninja-base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CPPLITE_WARNINGS_AS_ERRORS": "OFF"
}
},
{
"name": "release",
"inherits": "base",
"inherits": "ninja-base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CPPLITE_WARNINGS_AS_ERRORS": "OFF"
}
},
{
"name": "asan",
"inherits": "base",
"inherits": "ninja-base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CPPLITE_ENABLE_ASAN": "ON",
Expand All @@ -45,7 +50,7 @@
},
{
"name": "tsan",
"inherits": "base",
"inherits": "ninja-base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CPPLITE_ENABLE_TSAN": "ON",
Expand All @@ -54,12 +59,35 @@
},
{
"name": "ci",
"inherits": "base",
"inherits": "ninja-base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CPPLITE_WARNINGS_AS_ERRORS": "ON",
"CPPLITE_ENABLE_CLANG_TIDY": "ON"
}
},
{
"name": "windows-debug",
"displayName": "Windows Debug (Visual Studio 2022)",
"inherits": "base",
"generator": "Visual Studio 17 2022",
"architecture": "x64",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"cacheVariables": {
"CPPLITE_WARNINGS_AS_ERRORS": "OFF"
}
},
{
"name": "windows-release",
"displayName": "Windows Release (Visual Studio 2022)",
"inherits": "windows-debug",
"cacheVariables": {
"CPPLITE_WARNINGS_AS_ERRORS": "OFF"
}
}
],
"buildPresets": [
Expand All @@ -82,6 +110,16 @@
{
"name": "ci",
"configurePreset": "ci"
},
{
"name": "windows-debug",
"configurePreset": "windows-debug",
"configuration": "Debug"
},
{
"name": "windows-release",
"configurePreset": "windows-release",
"configuration": "Release"
}
],
"testPresets": [
Expand All @@ -98,6 +136,22 @@
"output": {
"outputOnFailure": true
}
},
{
"name": "windows-debug",
"configurePreset": "windows-debug",
"configuration": "Debug",
"output": {
"outputOnFailure": true
}
},
{
"name": "windows-release",
"configurePreset": "windows-release",
"configuration": "Release",
"output": {
"outputOnFailure": true
}
}
]
}
Loading
Loading