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
|
name: catalog-api
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
@ -21,6 +22,7 @@ on:
|
|||||||
env:
|
env:
|
||||||
SERVICE: catalog-api
|
SERVICE: catalog-api
|
||||||
IMAGE: catalog.api
|
IMAGE: catalog.api
|
||||||
|
DOTNET_VERSION: 5.0.x
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@ -31,6 +33,21 @@ jobs:
|
|||||||
- name: 'Checkout Github Action'
|
- name: 'Checkout Github Action'
|
||||||
uses: actions/checkout@master
|
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 }}
|
- name: Compose build ${{ env.SERVICE }}
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
||||||
working-directory: ./src
|
working-directory: ./src
|
||||||
@ -46,6 +63,21 @@ jobs:
|
|||||||
- name: 'Checkout Github Action'
|
- name: 'Checkout Github Action'
|
||||||
uses: actions/checkout@master
|
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
|
- name: Enable experimental features for the Docker daemon and CLI
|
||||||
run: |
|
run: |
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
||||||
|
Loading…
x
Reference in New Issue
Block a user