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
96 changes: 48 additions & 48 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,127 +54,127 @@
name: tracelogslinux
path: /home/txnproc/trace/

# buildwindows:
# name: "Build and Test Pull Requests - Windows"
# env:
# ASPNETCORE_ENVIRONMENT: "Production"
buildwindows:
name: "Build and Test Pull Requests - Windows"
env:
ASPNETCORE_ENVIRONMENT: "Production"

runs-on: windows-latest

steps:
- uses: actions/checkout@v1

- name: Install NET 9
uses: actions/setup-dotnet@v4.0.1
with:
dotnet-version: '9.0.x'

- name: Build Windows SQL Server
run: |
cd SQLDocker
docker build -t mssqlserver:2022-ltsc2022 --build-arg SQL_VERSION=2022 --build-arg WIN_VERSION=ltsc2022 .

- name: Restore Nuget Packages
run: dotnet restore Shared.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

- name: Build Code
run: dotnet build Shared.sln --configuration Release

- name: Run Unit Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "Shared.Tests\Shared.Tests.csproj"

- name: Run Event Store Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "Shared.EventStore.Tests\Shared.EventStore.Tests.csproj"
dotnet test "Shared.EventStoreContext.Tests\Shared.EventStoreContext.Tests.csproj"

- name: Run Integration Tests
env:
IsCI: true
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "Shared.IntegrationTesting.Tests\Shared.IntegrationTesting.Tests.csproj"

# runs-on: windows-latest

# steps:
# - uses: actions/checkout@v1

# - name: Install NET 9
# uses: actions/setup-dotnet@v4.0.1
# with:
# dotnet-version: '9.0.x'

# - name: Build Windows SQL Server
# run: |
# cd SQLDocker
# docker build -t mssqlserver:2022-ltsc2022 --build-arg SQL_VERSION=2022 --build-arg WIN_VERSION=ltsc2022 .

# - name: Restore Nuget Packages
# run: dotnet restore Shared.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

# - name: Build Code
# run: dotnet build Shared.sln --configuration Release

# - name: Run Unit Tests
# run: |
# echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
# dotnet test "Shared.Tests\Shared.Tests.csproj"

# - name: Run Event Store Tests
# run: |
# echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
# dotnet test "Shared.EventStore.Tests\Shared.EventStore.Tests.csproj"
# dotnet test "Shared.EventStoreContext.Tests\Shared.EventStoreContext.Tests.csproj"

# - name: Run Integration Tests
# env:
# IsCI: true
# run: |
# echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
# dotnet test "Shared.IntegrationTesting.Tests\Shared.IntegrationTesting.Tests.csproj"

# - uses: actions/upload-artifact@v4.4.3
# #if: ${{ failure() }}
# with:
# name: tracelogswindows
# path: C:\\Users\\runneradmin\\txnproc
- uses: actions/upload-artifact@v4.4.3
#if: ${{ failure() }}
with:
name: tracelogswindows
path: C:\\Users\\runneradmin\\txnproc

# buildmacos:
# name: "Build and Test Pull Requests - Mac"
# env:
# ASPNETCORE_ENVIRONMENT: "Production"

# runs-on: macos-latest

# steps:
# - uses: actions/checkout@v1

# - name: Install coreutils (includes timeout)
# run: brew install coreutils

# - name: Setup Docker with Colima
# run: |
# brew install docker --cask
# brew install colima
# gtimeout 180 colima start --cpu 2 --memory 4 --disk 60

# - name: Check Colima Status
# run: colima status

# - name: Print Colima Logs
# run: |
# cat /Users/runner/.colima/_lima/colima/ha.stderr.log
# cat /Users/runner/.colima/_lima/colima/ha.stdout.log

# # Verify Docker installation
# - name: Verify Docker Installation
# run: |
# docker --version
# docker ps

# - name: Restore Nuget Packages
# run: dotnet restore Shared.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

# - name: Build Code
# run: dotnet build Shared.sln --configuration Release

# - name: Trust root certificate
# run: |
# sudo cp ./Shared.EventStoreContext.Tests/certs/ca/ca.crt /usr/local/share/ca-certificates/ca.crt
# sudo security authorizationdb write com.apple.trust-settings.admin allow
# sudo security add-trusted-cert -d -r trustRoot -k "/Library/Keychains/System.keychain" /usr/local/share/ca-certificates/ca.crt
# sudo security authorizationdb remove com.apple.trust-settings.admin

# - name: Run Unit Tests
# run: |
# echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
# dotnet test "Shared.Tests\Shared.Tests.csproj"

# - name: Run Event Store Tests
# run: |
# echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
# dotnet test "Shared.EventStore.Tests\Shared.EventStore.Tests.csproj"
# dotnet test "Shared.EventStoreContext.Tests\Shared.EventStoreContext.Tests.csproj"

# - name: Run Integration Tests
# run: |
# echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
# dotnet test "Shared.IntegrationTesting.Tests\Shared.IntegrationTesting.Tests.csproj"

# - name: debug
# if: ${{ failure() }}
# run: docker container ls -a

# - uses: actions/upload-artifact@v4.4.3
# if: ${{ failure() }}
# with:
# name: tracelogsios
# path: /Users/runner/txnproc/trace/

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}



35 changes: 21 additions & 14 deletions Shared.IntegrationTesting/BaseDockerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@

// Setup the default image details
SimpleResults.Result<DockerEnginePlatform> engineType = BaseDockerHelper.GetDockerEnginePlatform();
if (engineType.Data == DockerEnginePlatform.Windows){
if (engineType.Data == DockerEnginePlatform.Windows)
{
this.ImageDetails.Add(ContainerType.SqlServer, ("iamrjindal/sqlserverexpress:2022", true));
this.ImageDetails.Add(ContainerType.EventStore, ("stuartferguson/eventstore_windows", true));
this.ImageDetails.Add(ContainerType.EventStore, ("stuartferguson/kurrentdb_windows", true));
this.ImageDetails.Add(ContainerType.MessagingService, ("stuartferguson/messagingservicewindows:master", true));
this.ImageDetails.Add(ContainerType.SecurityService, ("stuartferguson/securityservicewindows:master", true));
this.ImageDetails.Add(ContainerType.CallbackHandler, ("stuartferguson/callbackhandlerwindows:master", true));
Expand All @@ -147,9 +148,10 @@
this.ImageDetails.Add(ContainerType.FileProcessor, ("stuartferguson/fileprocessorwindows:master", true));
this.ImageDetails.Add(ContainerType.TransactionProcessorAcl, ("stuartferguson/transactionprocessoraclwindows:master", true));
}
else{
else
{
this.ImageDetails.Add(ContainerType.SqlServer, ("mcr.microsoft.com/mssql/server:2022-latest", true));
this.ImageDetails.Add(ContainerType.EventStore, ("eventstore/eventstore:24.10.0-jammy", true));
this.ImageDetails.Add(ContainerType.EventStore, ("kurrentplatform/kurrentdb:25.1", true));
this.ImageDetails.Add(ContainerType.MessagingService, ("stuartferguson/messagingservice:master", true));
this.ImageDetails.Add(ContainerType.SecurityService, ("stuartferguson/securityservice:master", true));
this.ImageDetails.Add(ContainerType.CallbackHandler, ("stuartferguson/callbackhandler:master", true));
Expand Down Expand Up @@ -547,28 +549,33 @@
Boolean reuseIfExists = false){
networkName = String.IsNullOrEmpty(networkName) ? $"testnw{this.TestId:N}" : networkName;
SimpleResults.Result<DockerEnginePlatform> engineType = BaseDockerHelper.GetDockerEnginePlatform();
Console.WriteLine($"Engine Type is {engineType.Data}");

if (engineType.Data == DockerEnginePlatform.Windows){
if (engineType.Data == DockerEnginePlatform.Windows)
{
var docker = BaseDockerHelper.GetDockerHost();
var network = docker.GetNetworks().SingleOrDefault(nw => nw.Name == networkName);
if (network == null){
if (network == null)
{
Dictionary<String, String> driverOptions = new Dictionary<String, String>();
driverOptions.Add("com.docker.network.windowsshim.networkname", networkName);

network = docker.CreateNetwork(networkName,
new NetworkCreateParams{
Driver = "nat",
DriverOptions = driverOptions,
Attachable = true,
});
new NetworkCreateParams
{
Driver = "nat",
DriverOptions = driverOptions,
Attachable = true,
});
}

return network;
}

if (engineType.Data == DockerEnginePlatform.Linux){
// Build a network
NetworkBuilder networkService = new Builder().UseNetwork(networkName).ReuseIfExist();
if (engineType.Data == DockerEnginePlatform.Linux)
{
// Build a network
NetworkBuilder networkService = new Builder().UseNetwork(networkName).ReuseIfExist();

return networkService.Build();
}
Expand Down Expand Up @@ -849,7 +856,7 @@
try{
await projectionClient.CreateContinuousAsync(projectionName, projection, trackEmittedStreams:true).ConfigureAwait(false);
}
catch (Exception ex) {

Check warning on line 859 in Shared.IntegrationTesting/BaseDockerHelper.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests - Linux

The variable 'ex' is declared but never used

Check warning on line 859 in Shared.IntegrationTesting/BaseDockerHelper.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests - Windows

The variable 'ex' is declared but never used
// ignored
}

Expand Down
Loading