Skip to content

Refactor requirements table in README.md #27

Refactor requirements table in README.md

Refactor requirements table in README.md #27

Workflow file for this run

name: master-build
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
# Cancel in-progress runs on the same branch when a new push arrives
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# ── 1. Compile the whole solution ─────────────────────────────────────────────
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore
- name: Build (Release)
run: dotnet build --no-restore --configuration Release
# ── 2. Core + SQLite tests (no external services required) ───────────────────
test-core:
name: "Tests — Core & SQLite"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore
- name: Build (Release)
run: dotnet build --no-restore --configuration Release
- name: "Test: ActiveForge.Tests (core)"
run: >
dotnet test tests/ActiveForge.Tests/ActiveForge.Tests.csproj
--no-build --configuration Release --verbosity normal
--logger "console;verbosity=normal"
- name: "Test: ActiveForge.SQLite.Tests"
run: >
dotnet test tests/ActiveForge.SQLite.Tests/ActiveForge.SQLite.Tests.csproj
--no-build --configuration Release --verbosity normal
--logger "console;verbosity=normal"
# ── 3. SQL Server tests (full suite against SQL Server 2022 in Docker) ─────────
test-sqlserver:
name: "Tests — SQL Server"
needs: build
runs-on: ubuntu-latest
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
env:
ACCEPT_EULA: "Y"
MSSQL_SA_PASSWORD: "Pa55w0rd!"
ports:
- 1433:1433
options: >-
--health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'Pa55w0rd!' -No -Q 'SELECT 1'"
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore
- name: Build (Release)
run: dotnet build --no-restore --configuration Release
- name: "Test: ActiveForge.SqlServer.Tests"
env:
SS_ADMIN_CONNSTR: "Server=localhost,1433;Database=master;User Id=sa;Password=Pa55w0rd!;TrustServerCertificate=True"
run: >
dotnet test tests/ActiveForge.SqlServer.Tests/ActiveForge.SqlServer.Tests.csproj
--no-build --configuration Release --verbosity normal
--logger "console;verbosity=normal"
# ── 4. PostgreSQL integration tests ──────────────────────────────────────────
test-postgres:
name: "Tests — PostgreSQL"
needs: build
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: Pa55w0rd
POSTGRES_DB: postgres
ports:
- 5455:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore
- name: Build (Release)
run: dotnet build --no-restore --configuration Release
- name: "Test: ActiveForge.PostgreSQL.Tests"
env:
PG_ADMIN_CONNSTR: "Host=localhost;Port=5455;Database=postgres;Username=postgres;Password=Pa55w0rd"
run: >
dotnet test tests/ActiveForge.PostgreSQL.Tests/ActiveForge.PostgreSQL.Tests.csproj
--no-build --configuration Release --verbosity normal
--logger "console;verbosity=normal"
# ── 5. MongoDB integration tests ─────────────────────────────────────────────
# Transactions require a replica set; service containers can't be started with
# --replSet, so we start MongoDB manually and initialise the replica set.
test-mongodb:
name: "Tests — MongoDB"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start MongoDB replica set
run: |
docker run -d --name mongo \
-p 27017:27017 \
mongo:7 --replSet rs0 --bind_ip_all
# Wait for mongod to accept connections
for i in $(seq 1 30); do
docker exec mongo mongosh --quiet --eval "db.adminCommand('ping')" \
&& break || sleep 2
done
# Initialise the single-node replica set
docker exec mongo mongosh --quiet --eval "rs.initiate({_id:'rs0',members:[{_id:0,host:'127.0.0.1:27017'}]})"
# Wait until the node becomes PRIMARY
for i in $(seq 1 20); do
STATUS=$(docker exec mongo mongosh --quiet --eval "rs.status().myState")
[ "$STATUS" = "1" ] && break || sleep 2
done
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore
- name: Build (Release)
run: dotnet build --no-restore --configuration Release
- name: "Test: ActiveForge.MongoDB.Tests"
run: >
dotnet test tests/ActiveForge.MongoDB.Tests/ActiveForge.MongoDB.Tests.csproj
--no-build --configuration Release --verbosity normal
--logger "console;verbosity=normal"