Skip to content

Commit 17dc8ef

Browse files
Adding unit tests
1 parent 47ca568 commit 17dc8ef

2 files changed

Lines changed: 48 additions & 1 deletion

File tree

.github/workflows/basket-api.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,22 @@ jobs:
3232
steps:
3333
- name: 'Checkout Github Action'
3434
uses: actions/checkout@master
35-
35+
36+
- name: Setup dotnet
37+
uses: actions/setup-dotnet@v1
38+
with:
39+
dotnet-version: ${{ env.DOTNET_VERSION }}
40+
41+
- name: Build and run unit tests
42+
run: |
43+
cd src
44+
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
45+
cd Services/Basket/Basket.API
46+
dotnet build --no-restore
47+
cd -
48+
cd Services/Basket/Basket.UnitTests
49+
dotnet test
50+
3651
- name: Compose build ${{ env.SERVICE }}
3752
run: sudo -E docker-compose build ${{ env.SERVICE }}
3853
working-directory: ./src

.github/workflows/ordering-api.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: ordering-api
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- dev
@@ -21,6 +22,7 @@ on:
2122
env:
2223
SERVICE: ordering-api
2324
IMAGE: ordering.api
25+
DOTNET_VERSION: 5.0.x
2426

2527
jobs:
2628

@@ -30,6 +32,21 @@ jobs:
3032
steps:
3133
- name: 'Checkout Github Action'
3234
uses: actions/checkout@master
35+
36+
- name: Setup dotnet
37+
uses: actions/setup-dotnet@v1
38+
with:
39+
dotnet-version: ${{ env.DOTNET_VERSION }}
40+
41+
- name: Build and run unit tests
42+
run: |
43+
cd src
44+
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
45+
cd Services/Ordering/Ordering.API
46+
dotnet build --no-restore
47+
cd -
48+
cd Services/Ordering/Ordering.UnitTests
49+
dotnet test
3350
3451
- name: Compose build ${{ env.SERVICE }}
3552
run: sudo -E docker-compose build ${{ env.SERVICE }}
@@ -45,6 +62,21 @@ jobs:
4562
steps:
4663
- name: 'Checkout Github Action'
4764
uses: actions/checkout@master
65+
66+
- name: Setup dotnet
67+
uses: actions/setup-dotnet@v1
68+
with:
69+
dotnet-version: ${{ env.DOTNET_VERSION }}
70+
71+
- name: Build and run unit tests
72+
run: |
73+
cd src
74+
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
75+
cd Services/Ordering/Ordering.API
76+
dotnet build --no-restore
77+
cd -
78+
cd Services/Ordering/Ordering.UnitTests
79+
dotnet test
4880
4981
- name: Enable experimental features for the Docker daemon and CLI
5082
run: |

0 commit comments

Comments
 (0)