Browse Source

Adding workflow_dispatch and unit tests

pull/1649/head
Colin Dembovsky 3 years ago
parent
commit
47ca5681f9
1 changed files with 32 additions and 0 deletions
  1. +32
    -0
      .github/workflows/catalog-api.yml

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

@ -1,6 +1,7 @@
name: catalog-api
on:
workflow_dispatch:
push:
branches:
- dev
@ -21,6 +22,7 @@ on:
env:
SERVICE: catalog-api
IMAGE: catalog.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/Catalog/Catalog.API
dotnet build --no-restore
cd -
cd Services/Catalog/Catalog.UnitTests
dotnet test
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
@ -46,6 +63,21 @@ jobs:
- 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/Catalog/Catalog.API
dotnet build --no-restore
cd -
cd Services/Catalog/Catalog.UnitTests
dotnet test
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json


Loading…
Cancel
Save