Browse Source

Adding unit tests

pull/1649/head
Colin Dembovsky 3 years ago
parent
commit
17dc8efb53
2 changed files with 48 additions and 1 deletions
  1. +16
    -1
      .github/workflows/basket-api.yml
  2. +32
    -0
      .github/workflows/ordering-api.yml

+ 16
- 1
.github/workflows/basket-api.yml View File

@ -32,7 +32,22 @@ jobs:
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build and run unit tests
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd Services/Basket/Basket.API
dotnet build --no-restore
cd -
cd Services/Basket/Basket.UnitTests
dotnet test
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src


+ 32
- 0
.github/workflows/ordering-api.yml View File

@ -1,6 +1,7 @@
name: ordering-api
on:
workflow_dispatch:
push:
branches:
- dev
@ -21,6 +22,7 @@ on:
env:
SERVICE: ordering-api
IMAGE: ordering.api
DOTNET_VERSION: 5.0.x
jobs:
@ -30,6 +32,21 @@ jobs:
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build and run unit tests
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd Services/Ordering/Ordering.API
dotnet build --no-restore
cd -
cd Services/Ordering/Ordering.UnitTests
dotnet test
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
@ -45,6 +62,21 @@ jobs:
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build and run unit tests
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd Services/Ordering/Ordering.API
dotnet build --no-restore
cd -
cd Services/Ordering/Ordering.UnitTests
dotnet test
- name: Enable experimental features for the Docker daemon and CLI
run: |


Loading…
Cancel
Save