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
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export NUGET_AUTH_USERNAME=
export NUGET_AUTH_TOKEN=
export SQLRACE_DLL_PATH="C:\Program Files\McLaren Applied Technologies\ATLAS 10\MESL.SqlRace.Domain.dll"
export ATLAS_EXE_PATH="C:\Program Files\McLaren Applied Technologies\ATLAS 10\ATLAS.exe"
export SQLRACE_CONNECTION_STRING=
63 changes: 0 additions & 63 deletions .gitattributes

This file was deleted.

40 changes: 40 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Contributing

Thank you for your interest in contributing to the SQL Race API Examples.

## Guidelines

### Snippets (Tier 1)

- Must be self-contained in a single file
- Must include all `using` statements and a `Main` method
- Must reference only `MESL.SQLRace.API` — no other dependencies
- Must be under 80 lines
- Must use domain-neutral parameter names (not motorsport-specific)
- Must default to a local SQLite connection string
- Must include a header comment block with title, description, prerequisites, and expected output

### Projects (Tier 2)

- Must build and run with `dotnet run`
- Should use the shared Core library where appropriate
- Must follow the same naming conventions as snippets

### General

- Use modern C# 12 / .NET 8 conventions
- Use `using` declarations for all `IDisposable` resources
- Never hard-code server names, file paths, or session GUIDs
- Write helpful error messages for null/not-found cases

## Submitting Changes

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Ensure all tests pass: `dotnet test`
5. Submit a pull request

## Reporting Issues

Use the [issue templates](ISSUE_TEMPLATE/) to report bugs, request examples, or suggest industry-specific scenarios.
44 changes: 0 additions & 44 deletions .github/workflows/Check-References.ps1

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/Get-Package-Version.ps1

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Restore projects
run: dotnet restore projects/csharp/SqlRace.Examples.sln
env:
NUGET_AUTH_USERNAME: ${{ secrets.PACKAGES_USERNAME }}
NUGET_AUTH_TOKEN: ${{ secrets.PACKAGES_PATTOKEN }}

- name: Build projects
run: dotnet build projects/csharp/SqlRace.Examples.sln --no-restore --configuration Release

- name: Restore tests
run: dotnet restore tests/SqlRace.Examples.Tests/SqlRace.Examples.Tests.csproj
env:
NUGET_AUTH_USERNAME: ${{ secrets.PACKAGES_USERNAME }}
NUGET_AUTH_TOKEN: ${{ secrets.PACKAGES_PATTOKEN }}

- name: Build tests
run: dotnet build tests/SqlRace.Examples.Tests/SqlRace.Examples.Tests.csproj --no-restore --configuration Release

# NOTE: Tests are NOT executed in CI. Several tests initialise the SQL Race
# runtime via SqlRaceBootstrapper, which requires a SQL Race licence that the
# CI runner does not have (LicenceException). CI verifies compilation only;
# run `dotnet test` locally on a licenced machine to execute the test suite.
48 changes: 0 additions & 48 deletions .github/workflows/pr.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/validate-notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Validate Notebooks

on:
push:
branches: [master]
paths: ['notebooks/**']
pull_request:
branches: [master]
paths: ['notebooks/**']

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: pip install nbformat

- name: Validate notebook JSON structure
run: |
python -c "
import nbformat, glob, sys
errors = []
for nb_path in sorted(glob.glob('notebooks/**/*.ipynb', recursive=True)):
try:
nb = nbformat.read(nb_path, as_version=4)
# Check basic structure
assert len(nb.cells) > 0, 'No cells'
assert nb.cells[0].cell_type == 'markdown', 'First cell should be markdown'
print(f' OK: {nb_path} ({len(nb.cells)} cells)')
except Exception as e:
errors.append(f'{nb_path}: {e}')
if errors:
print('\nErrors:')
print('\n'.join(errors))
sys.exit(1)
print(f'\nAll {len(list(glob.glob(\"notebooks/**/*.ipynb\", recursive=True)))} notebooks valid.')
"

- name: Check helpers module syntax
run: |
python -c "import ast; ast.parse(open('notebooks/sqlrace_helpers.py').read()); print('sqlrace_helpers.py syntax OK')"
Loading
Loading