Merging web-eid-asp-dotnet-example repository into web-eid-authtoken-validation-dotnet repository #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Dotnet build example | |
| on: [push, pull_request] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./example | |
| 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: Copy RIA repository key to keyrings | |
| run: sudo cp src/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 | |
| run: docker build -t web-eid-asp-dotnet-example . | |
| working-directory: ./example/src |