Skip to content

Use sonar.token instead of deprecated sonar.login #29

Use sonar.token instead of deprecated sonar.login

Use sonar.token instead of deprecated sonar.login #29

name: Dotnet example build
on:
push:
paths:
- 'example/**'
- '.github/workflows/*example*'
pull_request:
paths:
- 'example/**'
- '.github/workflows/*example*'
defaults:
run:
working-directory: ./example
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x # SDK Version to use.
- name: Cache Nuget packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: ${{ runner.os }}-nuget
- name: Install dependencies
run: dotnet restore src/WebEid.AspNetCore.Example.sln --source "https://gitlab.com/api/v4/projects/35362906/packages/nuget/index.json" --source "https://api.nuget.org/v3/index.json"
- name: Download RIA repository public key
run: wget https://github.com/web-eid/web-eid-asp-dotnet-example/raw/main/src/ria_public_key.gpg
- name: Copy RIA repository key to keyrings
run: sudo cp ria_public_key.gpg /usr/share/keyrings/ria-repository.gpg
- name: Add RIA repository to APT
run: |
echo "deb [signed-by=/usr/share/keyrings/ria-repository.gpg] https://installer.id.ee/media/ubuntu/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ria-repository.list
- name: Update APT and install libdigidocpp-csharp
run: |
sudo apt update
sudo apt install -y --no-install-recommends libdigidocpp-csharp
- name: Copy the necessary DigiDoc C# library files
run: sudo cp /usr/include/digidocpp_csharp/* src/WebEid.AspNetCore.Example/DigiDoc/
- name: Build
run: dotnet publish --configuration Release --no-restore src/WebEid.AspNetCore.Example.sln --verbosity normal
- name: Test
run: dotnet test --no-restore --verbosity normal src/WebEid.AspNetCore.Example.sln
- name: Test building Docker image
working-directory: ./example/src
run: docker build -t web-eid-asp-dotnet-example .