Category: github

TILT- Docker with Ductus.FluentDocker–part 23

I have already tests with Sqlite – however, it will be better to try tests with a real SqlServer .

One of the way to have a sql server is to have docker – but how to start docker with sql server any time ?

One of answers is Ductus.FluentDocker – – and this is the code to start SqlServer:

public override void StartDatabase()
    //string guid = Guid.NewGuid().ToString("N");
    string uniqueId = Interlocked.Increment(ref uniq).ToString(); //Guid.NewGuid().ToString("N");
    container =
new Builder()
.WithName("sql" + uniqueId)
.ExposePort(1433, 1433)
.WithEnvironment("SA_PASSWORD=<YourStrong@Passw0rd>", "ACCEPT_EULA=Y")
.WaitForMessageInLog("Starting up database 'tempdb'.", TimeSpan.FromSeconds(30))

static int uniq = 0;

I needed also a Base class for consolidating code between sql server and sqlite

  1. generating DI with for both with different context

  2. The Steps are the same = so base class

  3. The tests are the same= so base class

So this is the base class:

public  abstract partial class RealDBTests: FeatureFixture
    public void Start()
    public void Stop()

    public abstract void StartDatabase();

    public abstract void StopDatabase();

    public abstract IServiceCollection AddDB( IServiceCollection sc);

    public void ConstructServiceProvider()
        serviceProvider = AddDB(new ServiceCollection())
//more DI

Also , GitHub actions supports docker – so now TILT has a complete testing also in SqlServer.

Tools used


Visual Studio


TILT–CI and CD–part 6

Because the Source Control is Github and has Actions when submitting the code, I use this.

Also, when creating an Azure WebSite , you can integrate with Github and he will add the yaml for you and the secrets to deploy

I have added also badge to see the result of the action in the readme file. Deploy to Azure build

For the moment , just swagger available to see that the deploy was successfull . Results at

Tools used:

Github Actions:

NetCoreUsefullEndpoints-3 CICD

Now I find usefull that, every time that I push some code, the code is build and the nuget package is attached . So GitHub Actions to the rescue.

There will be 2 GitHub actions – one for build and package , other for deploying to the Azure a test application This is the code for building. ( The code for azure is automatically generated by Azure … so no need to put here)

name: .NET

    branches: [ "main" ]
    branches: [ "main" ]


    runs-on: ubuntu-latest

    - uses: actions/checkout@v3
    - name: Setup .NET
      uses: actions/setup-dotnet@v2
        dotnet-version: 6.0.x
    - name: Restore dependencies
      run: |
        cd src 
        cd UsefullEndpoints
        dotnet tool restore
        dotnet pwsh readme.ps1        
        dotnet restore
    - name: Build
      run: |
        cd src
        cd UsefullEndpoints
        dotnet build --no-restore
    - name: Pack
      run: |
        cd src
        cd UsefullEndpoints
        cd UsefullExtensions
        dotnet pack -o ../nugetPackages  --include-symbols --include-source

    - name: 'Upload nuget'
      #if: ${{ github.ref == 'refs/heads/main' }}
      uses: actions/upload-artifact@v2
        name: UsefullEndpoints_${{github.run_number}}
        path: src/UsefullEndpoints/nugetPackages
        retention-days: 1

You can see

  1. as Swagger at

  2. As BlocklyAutomation at

  3. As package at

Automatic release GitHub with version

For having releases published automatically on Github , I use this tagged release.yml file as an workflow

name: “tagged-release”
– “v*”

runs-on: ubuntu-latest

– name: ‘Checkout Github Action’
uses: actions/checkout@master

# code to build the source
– name: Archive production artifacts
uses: actions/upload-artifact@v2
name: nameOfTheApp
path: ‘src/…/*’
retention-days: 1

– name: Archive Release
uses: thedoctor0/zip-release@master
type: ‘zip’
filename: ‘’
path: ‘${{github.workspace}}/src/…’
exclusions: ‘*.git* /*node_modules/* .editorconfig’

– name: Release
uses: softprops/action-gh-release@v1
files: |

– name: delete older-releases@v0
uses: dev-drprasad/delete-older-releases@v0.2.0
#repo: / # defaults to current repo
keep_latest: 2
#delete_tag_pattern: beta # defaults to “”

FileExtension–part 6 – CI/CD

So now how to make visible all those coding ?

For tests –CodeCov, hosts for free to see the coverage

For documentation – ReadTheDocs, hosts for free.

For packaging  – NuGEt

For more detailed analysis Sonar can show code smells and bugs and more

GitHub actions allows me to run all those automatically and gather results

For showing a website – Azure  – can show the usage.

I was thinking that it is enough for the people to understand the application

My GITHUB integrations / apps

Github has integrations apps – means bots that automatically interacts with your repository. Those are the bots most used by me:


No Name Description
1 All Contributors Add contributions to the repository. Example at , see contributions added automatically
2 Img Bot Automatically optimizes the images and creates a PR for them . Example at
3 Todo Bot Allow  to transfer TODO comments in the code to create a new issue. Example :
4 Triage New Issues  When create a new issue without labels, put the triage label to be easy found later. For example,
5 Weekly Digest  If interested what’s new with your repositories. For example,
6 Depend A Bot Scans the repository for outdated


Also, I am a big fan of GitHub Actions – easy to use. See an example at

HCV–automatic CI–part 6

I want the tests to be run automatically . And have a code coverage report. So Docker will be generating the report ( with coverlet.console and dotnet-reportgenerator-globaltool ). The GitHub Actions will be responsible with running this every time. The docs folder will be responsible of hosting it .

The code for docker resides in  \src\copyFilesToDocker.txt

ENV NODE_ROOT usr/app/

COPY HealthCheckVersion .
RUN dotnet tool install –global coverlet.console –version 1.7.2
RUN dotnet tool install  -g dotnet-reportgenerator-globaltool –version 4.6.1
RUN dotnet test TestHealthCheckVersion/TestHealthCheckVersion.csproj –logger trx  –logger “console;verbosity=normal” –collect “Code coverage”
ENV PATH=”${PATH}:/root/.dotnet/tools”
RUN coverlet TestHealthCheckVersion/bin/Debug/netcoreapp3.1/TestHealthCheckVersion.dll –target “dotnet” –targetargs “test TestHealthCheckVersion/TestHealthCheckVersion.csproj –configuration Debug –no-build”  –format opencover –exclude “[xunit*]*” –exclude “[*]NetCoreTestProject*”
RUN reportgenerator “-reports:coverage.opencover.xml” “-targetdir:coveragereport” “-reporttypes:HTMLInline;HTMLSummary;Badges”
CMD tail -f /dev/null

The running  the docker is in \src\testNetCoreWin.bat

ECHO please be aware of absolute path here %cd%
docker build -t testcinetcore -f copyFilesToDocker.txt .
docker run -d –name citest  testcinetcore
docker cp citest:/usr/app/coveragereport .
docker container kill citest
docker container rm citest

The code for Github CI is in \.github\workflows\docker-image.yml

name: GenerateCodeCoverage



branches: [ master ]


branches: [ master ]



runs-on: ubuntu-latest


– uses: actions/checkout@v2

– name: Build the Docker image for code coverage

run: |

cd src

chmod +777 ./testNetCoreWin.bat


ls -lh

echo ‘copy’

cp -r  ./coveragereport/* ../docs/coveragereport/

rm -R ./coveragereport/

echo ‘in docs/coveragereport’

ls -lh ../docs/coveragereport/

echo ‘here’

ls -lh

– name: run commit

run: |

git config –local “”

git config –local “GitHub Action”

git add –all

git status

git commit -m “generate code coverage” -a –allow-empty

#shell: cmd

– name: Push changes

uses: ad-m/github-push-action@master


github_token: ${{ secrets.GITHUB_TOKEN }}

And now I can update readme with CI badge and code coverage test and badge


You can see the modifications at


Health Check for Version
1Idea and Github
5Test Application

Generating outdated, licenses and thanks with .NET Core tools

Last time ( I have discussed about local tools . Now it is time to show something in practice, beside code coverage ( detailed and video  ) ,

Let’ make something simple: generate outdated packages list, licenses and thanks.

I will use this packages

“dotnet-project-licenses”: {

“version”: “2.1.0”,

“commands”: [




“dotnetthx”: {

“version”: “0.2.0”,

“commands”: [




“dotnet-depends”: {

“version”: “0.4.0”,

“commands”: [




“dotnet-outdated”: {

“version”: “2.11.0”,

“commands”: [




And I will make a github action to run  to generate the outdated, licenses and thanks

name: .NET Core



branches: [ master ]



runs-on: windows-latest


– uses: actions/checkout@v2

– name: Setup .NET Core

uses: actions/setup-dotnet@v1


dotnet-version: 3.1.101

– name: Install dependencies

run: |

        cd src

        cd NetCore2Blockly

        dotnet restore

        echo ‘done restore’

        dotnet tool restore –add-source

        dotnet dotnet-project-licenses  -j  -i .

        echo ‘done project licences’

        dotnet dotnet-thx > thanks.txt

        echo ‘done thanks’

        dotnet dotnet-outdated -o outdated.csv -of csv

        echo ‘done outdated’

        dotnet pwsh copyToRoot.ps1

        cd ..

        cd ..

        echo ‘back to source dir’

– name: test

run: echo done

– name: run commit

run: |

        git config –local “”

        git config –local “GitHub Action”

        git add –all

        git status

        git commit -m “generate thanks, outdate, licences” -a –allow-empty

shell: cmd

– name: Push changes

uses: ad-m/github-push-action@master


github_token: ${{ secrets.GITHUB_TOKEN }}

The powershell file that copies everything is here:

Move-Item .\licenses.json ..\..\licencesNetCore.json

Write-Host ‘copied licenses.json ‘

Move-Item .\outdated.csv ..\..\outdatedNetCore.csv

Write-Host ‘copied outdated.csv ‘

Move-Item .\thanks.txt ..\..\thanksNetCore.txt

Write-Host ‘copied thanks.txt ‘

And  you can see the result at

You can find also a list of tools here:

Covid Data -CI/ CD–part 5

Now I need that every data ( either from the github .md file, either gathered from ) be updated into the site.

Github Actions to the rescue!

I have created 2 different workflows : one for gathering the data from the , the other for compiling the .md files and the Angular app. Thinking more, I should have had the Angular compiled into another workflow that was called after each one – but this is more AzureDevOps , than GitHub Actions.

1. Workflow for .md and for Angular

You can find the source at . It uses a Docker file to compile the Angular: and a Docker batch to run the docker file and gather the results :

Uses all the previous js and TypeScript files to transform and load data. Copies the data into the docs folder ( to be public available ) and then commits the data back to Github

It is run on both push at a cron job





– cron: ‘5 4 * * *’

2. Workflow for gather last country data for Covid

You can find the source at .It uses also a Docker file to compile data and run 

And a docker compile file to gather the data from docker.

Also the workflow commits data to github.  It is run at a cron job:



– cron: ‘5 2 * * *’

Covid Data–transforming – part 3

I figured out that from data ( .md files and .js files) I need to have a proper data to be processed by the application. Since the application will be a static web app, the easy way is to be a generated js file to be imported into the application.

1.   MD to js

So now I must figure a way to transforme .md files into .js files. I was having dreams about Stankins , but it is not yet ready. So Js to the rescue. You can find the .js file here:

It reads  the folders files

var folders = [“Country”,”Entertainment”,”FreeSoftware”, “Kids”,”Learn”,”MapsAndData”,”NotParsed”];


for (let folder of folders) {

const directoryPath = path.join(__dirname + “/..”, folder);

const list = await rra.list(directoryPath);

then parses a file( e.g. )  with a lexer

const tokens = marked.lexer(fileContents);

for(let iToken=0;iToken<tokens.length;iToken++){

and writes to a file


2. Importing  Country data  for Covid

Now I need every data for Covid. I figure out the the only one that have the data is . However , the data is not always in the same form.

Again, because t Stankins is not yet ready, I recurse to TypeScript. It is better that JS for me – it keeps tracking the errors that you may have . You can find the file at

Some pain points :

or there are not always countries – see const NotCountry where  “Diamond Princess” and “MS Zaandam” are countries ( there are cruise ships)

  • I should verify if there is always data for this day, if it exists for the previous ( yes, I know, Covid will eventually disappear or not be registered otherwise than influenza –but, for the moment ,it is ok) :  see async function Verify in
  • I have had problems finding a CSV parser to TypeScript – I have found papaparse

3. Importing other data

I need to have the country population for each country, to display the relative percentage of the people . For this, I have the data from – but how to import into already existing data ?

Simple: Import data into Excel. Make a case instruction with each country, iterate via countries, ( find discrepancies in names – use alternate names for this) and put the property as js , save the file. See


Andrei Ignat weekly software news(mostly .NET)

* indicates required

Please select all the ways you would like to hear from me:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.