|
| 1 | +name: Dotnet build example |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + |
| 9 | + defaults: |
| 10 | + run: |
| 11 | + working-directory: ./example |
| 12 | + |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Setup dotnet |
| 17 | + uses: actions/setup-dotnet@v4 |
| 18 | + with: |
| 19 | + dotnet-version: 8.0.x # SDK Version to use. |
| 20 | + |
| 21 | + - name: Cache Nuget packages |
| 22 | + uses: actions/cache@v4 |
| 23 | + with: |
| 24 | + path: ~/.nuget/packages |
| 25 | + # Look to see if there is a cache hit for the corresponding requirements file |
| 26 | + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} |
| 27 | + restore-keys: ${{ runner.os }}-nuget |
| 28 | + |
| 29 | + - name: Install dependencies |
| 30 | + 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" |
| 31 | + |
| 32 | + - name: Copy RIA repository key to keyrings |
| 33 | + run: sudo cp src/ria_public_key.gpg /usr/share/keyrings/ria-repository.gpg |
| 34 | + |
| 35 | + - name: Add RIA repository to APT |
| 36 | + run: | |
| 37 | + 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 |
| 38 | +
|
| 39 | + - name: Update APT and install libdigidocpp-csharp |
| 40 | + run: | |
| 41 | + sudo apt update |
| 42 | + sudo apt install -y --no-install-recommends libdigidocpp-csharp |
| 43 | +
|
| 44 | + - name: Copy the necessary DigiDoc C# library files |
| 45 | + run: | |
| 46 | + ls -R |
| 47 | + sudo cp /usr/include/digidocpp_csharp/* src/WebEid.AspNetCore.Example/DigiDoc/ |
| 48 | +
|
| 49 | + - name: Build |
| 50 | + run: dotnet publish --configuration Release --no-restore src/WebEid.AspNetCore.Example.sln --verbosity normal |
| 51 | + |
| 52 | + - name: Test |
| 53 | + run: dotnet test --no-restore --verbosity normal src/WebEid.AspNetCore.Example.sln |
| 54 | + |
| 55 | + - name: Test building Docker image |
| 56 | + run: docker build -t web-eid-asp-dotnet-example . |
| 57 | + working-directory: ./example/src |
0 commit comments