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
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Text is LF on every platform (tools/build.php refuses CR)
* text=auto eol=lf

# noneDB.php is built from src/ by tools/build.php; packages ship only the built files
/src export-ignore
/migrate export-ignore
/tools export-ignore
/tests export-ignore
/docs export-ignore
/examples export-ignore
/build export-ignore
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml export-ignore
/CHANGES.md export-ignore
noneDB.php linguist-generated=true
118 changes: 115 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,74 @@ on:
branches: [main, master, dev]

jobs:
fixtures:
# The databases the earlier releases write themselves: the Migration suite reads them, git keeps none
name: Migration fixtures
runs-on: ubuntu-latest

steps:
- name: Checkout code with its history (the earlier releases come from git)
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup PHP 7.4 (releases before 3.2)
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: json, mbstring, posix
coverage: none

- name: Keep its path
run: echo "NONEDB_PHP74=$(php -r 'echo PHP_BINARY;')" >> $GITHUB_ENV

- name: Setup PHP 8.2
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: json, mbstring, posix
coverage: none

- name: Make the fixtures
run: php tools/make-migration-fixtures.php

- name: Pack them (dot files included, bytes as written)
run: tar -czf migration-fixtures.tgz -C tests/Migration fixtures

- name: Hand them to the other jobs
uses: actions/upload-artifact@v4
with:
name: migration-fixtures
path: migration-fixtures.tgz
retention-days: 1

test:
name: PHP ${{ matrix.php-version }}
needs: fixtures
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
php-version: ['8.1', '8.2', '8.3', '8.4', '8.5']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get the migration fixtures
uses: actions/download-artifact@v4
with:
name: migration-fixtures

- name: Unpack them
run: tar -xzf migration-fixtures.tgz -C tests/Migration

- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: json, mbstring
extensions: json, mbstring, posix, pdo_sqlite
tools: composer:v2
coverage: none

Expand All @@ -46,9 +96,23 @@ jobs:
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction

- name: Run PHPUnit tests (Unit, Feature, Integration, Regression)
- name: Check that noneDB.php is the build of src/
run: php tools/build.php --check

- name: Run PHPUnit (Unit, Integration, Crash, Concurrency, Differential, Migration)
run: vendor/bin/phpunit --testdox --colors=always

- name: Run the examples of the documentation against noneDB.php
run: php tests/Docs/doctest.php

- name: Run the SQLite comparison once (a smoke test, no timing is checked)
run: php tests/Performance/sqlite_comparison.php 100 --runs=1

- name: Run the standalone smoke checks
run: |
php tests/Smoke/noneDB_regression_smoke.php
php tests/Smoke/noneDB_critical_scope_regression.php

- name: Run the examples (each must finish without warnings)
run: |
for f in examples/*.php; do
Expand All @@ -60,3 +124,51 @@ jobs:
- name: Cleanup test databases
if: always()
run: rm -rf tests/test_db examples/db

windows:
# Windows (file locking, rename retries)
name: PHP ${{ matrix.php-version }} (Windows)
needs: fixtures
runs-on: windows-latest

strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.4']

defaults:
run:
shell: bash

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get the migration fixtures
uses: actions/download-artifact@v4
with:
name: migration-fixtures

- name: Unpack them
run: tar -xzf migration-fixtures.tgz -C tests/Migration

- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: json, mbstring
tools: composer:v2
coverage: none

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction

- name: Check that noneDB.php is the build of src/
run: php tools/build.php --check

- name: Run PHPUnit tests
run: vendor/bin/phpunit --colors=always

- name: Cleanup test databases
if: always()
run: rm -rf tests/test_db examples/db
29 changes: 28 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,28 @@
composer.phar
composer.lock

# Database files
# Database files (noneDB 4 store; files of earlier versions until they are migrated)
/db/*.ndb4/
/db/STORE
/db/STORE.2
/db/STORE.LOCK
/db/STORE*.tmp*
/db/.nonedb-maintenance/
/db/.nonedb-retained/
/db/*.nonedb
/db/*.nonedbinfo
/db/*.nonedb.*

# Test artifacts
/tests/test_db/
/tests/build/
.phpunit.result.cache
.phpunit.cache/

# IDE
.idea/
.vscode/
.claude/
*.sublime-*

# OS
Expand All @@ -38,3 +47,21 @@ CLAUDE.md

# Example databases
/examples/db/

# Evidence stays on this machine; git keeps only the frozen baseline (the gate and the 3.3-dev fixtures need it)
/build/*
!/build/baseline/

*.nonedb
*.jidx
*.meta
*.backup
*.nonedbinfo

# Databases the earlier releases wrote: tools/make-migration-fixtures.php makes them from git (CI too)
/tests/Migration/fixtures/

# Working notes, a tool of the 3.3 gates nothing uses any more
/v4.0.0.plan.md
/docs/v4/
/tools/gate-evidence.php
1 change: 0 additions & 1 deletion .nonedb.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"autoCreateDB": true,
"shardingEnabled": true,
"shardSize": 10000,
"autoMigrate": true,
"autoCompactThreshold": 0.3,
"lockTimeout": 5,
"lockRetryDelay": 10000
Expand Down
Loading
Loading