Skip to content

Correção Teste Unitário HomeBrokerBusinessTest #112

Correção Teste Unitário HomeBrokerBusinessTest

Correção Teste Unitário HomeBrokerBusinessTest #112

name: Build and Test
on:
workflow_call:
push:
branches:
- main
- develop
pull_request:
types: [opened]
branches:
- main
permissions:
contents: read
jobs:
build_and_test_net:
name: Build and Test .Net App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache .NET packages
uses: actions/cache@v3
id: dotnet-cache
with:
path: ~/.nuget/packages
key: dotnet-packages-${{ github.repository }}
restore-keys: dotnet-packages-${{ github.repository }}
- name: Setup .NET
uses: actions/setup-dotnet@v3
if: steps.dotnet-cache.outputs.cache-hit != 'true'
with:
dotnet-version: 8.0.x
- name: Build and Restore App
run: dotnet build ./HomeBrokerSPA/HomeBroker.SPA.csproj --restore
continue-on-error: false
- name: Test .Net App
run: |
dotnet tool install -g dotnet-reportgenerator-globaltool
dotnet test ./HomeBrokerXUnit/HomeBroker.XUnit.csproj
continue-on-error: false
build_and_test_angular:
needs: build_and_test_net
name: Build and Test Angular App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Angular dependencies
run: |
cd HomeBrokerSPA/HomeBrokerChart
npm install npm@latest > /dev/null 2>&1
npm install -g @angular/cli > /dev/null 2>&1
npm install
continue-on-error: false
- name: Build Angular App
run: |
cd HomeBrokerSPA/HomeBrokerChart
npm run build
continue-on-error: false
- name: Test Angular App
run: |
cd HomeBrokerSPA/HomeBrokerChart
npm run test:coverage
continue-on-error: false
# trigger_tests_sonarcloud:
# needs: build_and_test_angular
# name: Triggered Build and Test
# uses: alexfariakof/app-home-broker-chart/.github/workflows/test_analyse_in_Sonar_Cloud.yml@main
# secrets: inherit