Skip to content

F# Type Provider for LQL with Compile-Time Validation #46

F# Type Provider for LQL with Compile-Time Validation

F# Type Provider for LQL with Compile-Time Validation #46

Workflow file for this run

name: CI
on:
push:
branches: [main]
paths:
- '**/*.cs'
- '**/*.csproj'
- '**/*.sln'
- '**/Directory.Build.props'
- '**/Directory.Packages.props'
- '.github/workflows/ci.yml'
- '.config/dotnet-tools.json'
pull_request:
branches: [main]
paths:
- '**/*.cs'
- '**/*.csproj'
- '**/*.sln'
- '**/Directory.Build.props'
- '**/Directory.Packages.props'
- '.github/workflows/ci.yml'
- '.config/dotnet-tools.json'
workflow_dispatch:
env:
DOTNET_VERSION: '9.0.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
# Detect which areas changed to conditionally run tests
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
dataprovider: ${{ steps.filter.outputs.dataprovider }}
lql: ${{ steps.filter.outputs.lql }}
migration: ${{ steps.filter.outputs.migration }}
sync: ${{ steps.filter.outputs.sync }}
gatekeeper: ${{ steps.filter.outputs.gatekeeper }}
samples: ${{ steps.filter.outputs.samples }}
dashboard: ${{ steps.filter.outputs.dashboard }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
dataprovider:
- 'DataProvider/**'
- 'Directory.Build.props'
- 'Directory.Packages.props'
lql:
- 'Lql/**'
- 'DataProvider/**'
- 'Directory.Build.props'
- 'Directory.Packages.props'
migration:
- 'Migration/**'
- 'Directory.Build.props'
- 'Directory.Packages.props'
sync:
- 'Sync/**'
- 'Migration/**'
- 'Directory.Build.props'
- 'Directory.Packages.props'
gatekeeper:
- 'Gatekeeper/**'
- 'DataProvider/**'
- 'Migration/**'
- 'Directory.Build.props'
- 'Directory.Packages.props'
samples:
- 'Samples/**'
- 'DataProvider/**'
- 'Sync/**'
- 'Migration/**'
- 'Gatekeeper/**'
- 'Directory.Build.props'
- 'Directory.Packages.props'
dashboard:
- 'Samples/Dashboard/**'
- 'Samples/Clinical/**'
- 'Samples/Scheduling/**'
- 'DataProvider/**'
- 'Sync/**'
- 'Migration/**'
- 'Gatekeeper/**'
- 'Directory.Build.props'
- 'Directory.Packages.props'
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
${{ env.DOTNET_VERSION }}
- name: Restore .NET tools
run: |
dotnet tool restore
# Verify h5 tool is available
dotnet tool run h5 --version || echo "h5 tool check (may fail if no version flag)"
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release -p:SkipTypeProviderCodeGen=true
# DataProvider tests
dataprovider-tests:
name: DataProvider Tests
runs-on: ubuntu-latest
needs: [build, changes]
if: needs.changes.outputs.dataprovider == 'true'
strategy:
fail-fast: false
matrix:
project:
- DataProvider/DataProvider.Tests
- DataProvider/DataProvider.Example.Tests
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore
run: dotnet restore ${{ matrix.project }}
- name: Test
run: dotnet test ${{ matrix.project }} --no-restore --verbosity normal --logger "trx;LogFileName=test-results.trx"
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-dataprovider-${{ strategy.job-index }}
path: '**/TestResults/*.trx'
# LQL tests
lql-tests:
name: LQL Tests
runs-on: ubuntu-latest
needs: [build, changes]
if: needs.changes.outputs.lql == 'true'
strategy:
fail-fast: false
matrix:
project:
- Lql/Lql.Tests
- Lql/LqlCli.SQLite.Tests
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore
run: dotnet restore ${{ matrix.project }}
- name: Test
run: dotnet test ${{ matrix.project }} --no-restore --verbosity normal --logger "trx;LogFileName=test-results.trx"
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-lql-${{ strategy.job-index }}
path: '**/TestResults/*.trx'
# LQL F# Type Provider tests
lql-fsharp-typeprovider-tests:
name: LQL F# Type Provider Tests
runs-on: ubuntu-latest
needs: [build, changes]
if: needs.changes.outputs.lql == 'true'
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.fsproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore
run: dotnet restore Lql/Lql.TypeProvider.FSharp.Tests
- name: Build CLI tools (needed by MSBuild targets)
run: |
dotnet build Migration/Migration.Cli -c Debug
dotnet build DataProvider/DataProvider.SQLite.Cli -c Debug
- name: Test
run: dotnet test Lql/Lql.TypeProvider.FSharp.Tests --no-restore --verbosity normal --logger "trx;LogFileName=test-results.trx"
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-lql-fsharp-typeprovider
path: '**/TestResults/*.trx'
# Migration tests
migration-tests:
name: Migration Tests
runs-on: ubuntu-latest
needs: [build, changes]
if: needs.changes.outputs.migration == 'true'
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore
run: dotnet restore Migration/Migration.Tests
- name: Test
run: dotnet test Migration/Migration.Tests --no-restore --verbosity normal --logger "trx;LogFileName=test-results.trx"
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-migration
path: '**/TestResults/*.trx'
# Sync SQLite tests (no Docker)
sync-sqlite-tests:
name: Sync SQLite Tests
runs-on: ubuntu-latest
needs: [build, changes]
if: needs.changes.outputs.sync == 'true'
strategy:
fail-fast: false
matrix:
project:
- Sync/Sync.Tests
- Sync/Sync.SQLite.Tests
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore
run: dotnet restore ${{ matrix.project }}
- name: Test
run: dotnet test ${{ matrix.project }} --no-restore --verbosity normal --logger "trx;LogFileName=test-results.trx"
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-sync-sqlite-${{ strategy.job-index }}
path: '**/TestResults/*.trx'
# Sync Postgres tests (need Docker)
sync-postgres-tests:
name: Sync Postgres Tests
runs-on: ubuntu-latest
needs: [build, changes]
if: needs.changes.outputs.sync == 'true'
strategy:
fail-fast: false
matrix:
project:
- Sync/Sync.Postgres.Tests
- Sync/Sync.Integration.Tests
- Sync/Sync.Http.Tests
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore
run: dotnet restore ${{ matrix.project }}
- name: Test
run: dotnet test ${{ matrix.project }} --no-restore --verbosity normal --logger "trx;LogFileName=test-results.trx"
env:
TESTCONTAINERS_RYUK_DISABLED: false
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-sync-postgres-${{ strategy.job-index }}
path: '**/TestResults/*.trx'
# Gatekeeper API tests
gatekeeper-tests:
name: Gatekeeper Tests
runs-on: ubuntu-latest
needs: [build, changes]
if: needs.changes.outputs.gatekeeper == 'true'
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore
run: dotnet restore Gatekeeper/Gatekeeper.Api.Tests
- name: Test
run: dotnet test Gatekeeper/Gatekeeper.Api.Tests --no-restore --verbosity normal --logger "trx;LogFileName=test-results.trx"
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-gatekeeper
path: '**/TestResults/*.trx'
# Sample API tests
sample-api-tests:
name: Sample API Tests
runs-on: ubuntu-latest
needs: [build, changes]
if: needs.changes.outputs.samples == 'true'
strategy:
fail-fast: false
matrix:
project:
- Samples/Clinical/Clinical.Api.Tests
- Samples/Scheduling/Scheduling.Api.Tests
- Samples/Dashboard/Dashboard.Web.Tests
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
${{ env.DOTNET_VERSION }}
- name: Restore .NET tools
run: dotnet tool restore
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore
run: dotnet restore ${{ matrix.project }}
- name: Test
run: dotnet test ${{ matrix.project }} --no-restore --verbosity normal --logger "trx;LogFileName=test-results.trx"
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-sample-api-${{ strategy.job-index }}
path: '**/TestResults/*.trx'
# Dashboard E2E tests (need Playwright browser)
e2e-tests:
name: Dashboard E2E Tests
runs-on: ubuntu-latest
needs: [build, changes]
if: needs.changes.outputs.dashboard == 'true'
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
${{ env.DOTNET_VERSION }}
- name: Restore .NET tools
run: dotnet tool restore
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore Dashboard.Web
run: dotnet restore Samples/Dashboard/Dashboard.Web
- name: Build Dashboard.Web (downloads React vendor files)
run: dotnet build Samples/Dashboard/Dashboard.Web -c Release --no-restore
- name: Build Sync projects (required for Sync E2E tests)
run: |
dotnet build Samples/Clinical/Clinical.Sync -c Release
dotnet build Samples/Scheduling/Scheduling.Sync -c Release
- name: Build Integration Tests (includes wwwroot copy)
run: dotnet build Samples/Dashboard/Dashboard.Integration.Tests -c Release
- name: Install Playwright browsers
run: dotnet tool install --global Microsoft.Playwright.CLI && playwright install --with-deps chromium
- name: Verify wwwroot files
run: |
echo "=== Dashboard.Web wwwroot (source) ==="
ls -la Samples/Dashboard/Dashboard.Web/wwwroot/js/ || echo "Dashboard.Web js folder not found"
ls -la Samples/Dashboard/Dashboard.Web/wwwroot/js/vendor/ || echo "Dashboard.Web vendor folder not found"
echo "=== Integration Tests wwwroot (output) ==="
ls -la Samples/Dashboard/Dashboard.Integration.Tests/bin/Release/net9.0/wwwroot/js/ || echo "Integration Tests js folder not found"
ls -la Samples/Dashboard/Dashboard.Integration.Tests/bin/Release/net9.0/wwwroot/js/vendor/ || echo "Integration Tests vendor folder not found"
- name: Test
run: dotnet test Samples/Dashboard/Dashboard.Integration.Tests -c Release --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx"
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-e2e
path: '**/TestResults/*.trx'
- name: Upload Playwright traces
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-traces
path: '**/playwright-traces/**'