Skip to content

Improve testing

Improve testing #366

Workflow file for this run

name: Build and Test
env:
solution_file: 'src/Vipps.net.sln'
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
paths-ignore:
- 'docs/**'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
strategy:
matrix:
dotnet-version: [ '8.0.x' ]
defaults:
run:
working-directory: ./src
steps:
- name: Get repo
uses: actions/checkout@v3
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install Paket
run: dotnet tool install Paket --tool-path .paket
- name: Install dependencies
run: |
.paket/paket install
- name: Build Vipps.net.models.Epayment
run: dotnet build Vipps.net.Models.Epayment/Vipps.net.Models.Epayment.csproj --no-restore --configuration Release
- name: Build Vipps.net.models.Checkout
run: dotnet build Vipps.net.Models.Checkout/Vipps.net.Models.Checkout.csproj --no-restore --configuration Release
- name: Build vipps.net
run: dotnet build Vipps.net/Vipps.net.csproj --no-restore --configuration Release
- name: Install dependencies Vipps.net.Demo
run: dotnet restore Vipps.net.Demo/Vipps.net.Demo.csproj
- name: Build Vipps.net.Demo
run: dotnet build Vipps.net.Demo/Vipps.net.Demo.csproj --no-restore
- name: Install dependencies Vipps.net.AspCoreDemo
run: dotnet restore Vipps.net.AspCoreDemo/Vipps.net.AspCoreDemo.csproj
- name: Build Vipps.net.AspCoreDemo
run: dotnet build Vipps.net.AspCoreDemo/Vipps.net.AspCoreDemo.csproj --no-restore
- name: CSharpier check
run: |
dotnet tool restore --tool-manifest .config/dotnet-tools.json
dotnet csharpier . --check
- name: Install dependencies for IntegrationTests
run: dotnet restore Tests/Vipps.net.IntegrationTests/Vipps.net.IntegrationTests.csproj
- name: Pack NuGet Package with Paket
run: |
.paket/paket pack Vipps.net --version 0.0.0
- name: Run Tests
run: dotnet test Tests/Vipps.net.IntegrationTests/Vipps.net.IntegrationTests.csproj --no-restore --verbosity normal --environment vmp_net_sdk_CLIENT_ID=${{ secrets.CLIENT_ID }} --environment vmp_net_sdk_CLIENT_SECRET=${{ secrets.CLIENT_SECRET }} --environment vmp_net_sdk_SUBSCRIPTION_KEY=${{ secrets.SUBSCRIPTION_KEY }} --environment vmp_net_sdk_MERCHANT_SERIAL_NUMBER=${{ secrets.MERCHANT_SERIAL_NUMBER }}
- name: Run Integration Tests
run: dotnet test Tests/Vipps.net.IntegrationTests/Vipps.net.IntegrationTests.csproj --no-restore --verbosity normal --environment vmp_net_sdk_CLIENT_ID=${{ secrets.CLIENT_ID }} --environment vmp_net_sdk_CLIENT_SECRET=${{ secrets.CLIENT_SECRET }} --environment vmp_net_sdk_SUBSCRIPTION_KEY=${{ secrets.SUBSCRIPTION_KEY }} --environment vmp_net_sdk_MERCHANT_SERIAL_NUMBER=${{ secrets.MERCHANT_SERIAL_NUMBER }}