Adding workflow_dispatch and unit tests
This commit is contained in:
parent
99e86312f9
commit
47ca5681f9
32
.github/workflows/catalog-api.yml
vendored
32
.github/workflows/catalog-api.yml
vendored
@ -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:
|
||||
|
||||
@ -31,6 +33,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: Compose build ${{ env.SERVICE }}
|
||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
||||
working-directory: ./src
|
||||
@ -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…
x
Reference in New Issue
Block a user