-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (70 loc) · 3.61 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# This is a basic workflow to help you get started with Actions
# run: dotnet test $env:Test_Project_Path --no-restore --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
#last
name: WorkFlow CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: '*'
pull_request:
branches: 'main'
jobs:
##############################################################################################################################################################################################
build:
strategy:
matrix:
dotnet-version: [ '3.1.x' ]
type: [unitarias]
runs-on: windows-latest
env:
Solution_Name: src\WebApplicationDGP.sln
Test_Project_Path: src\TestProject1\TestProject1.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
Wap_Project_Path: src\WebApplicationDGP/WebApplicationDGP.csproj # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj.
working_directory: src\WebApplicationDGP
test_result_path: src\TestProject1\TestResults
AZURE_WEBAPP_NAME_DEV: uksouth-iflx-shar-WebApplicationDGP-dev-app # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: 'src\WebApplicationDGP\bin\Debug\netcoreapp3.1\publish\' # set this to the path to your web app project, defaults to the repository root
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: Install dependencies
run: dotnet restore $env:Wap_Project_Path
- name: Build
run: dotnet build $env:Wap_Project_Path
##############################################################################################################################################################################################
TestUnitarios:
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v2
- name: Test with the dotnet CLI
run: dotnet test src\TestProject1\TestProject1.csproj --logger trx --results-directory src\TestProject1\TestResults
# Using the trx-parser action
- name: trx-parser
uses: NasAmin/trx-parser@v0.2.0
id: trx-parser
with:
TRX_PATH: ${{ github.workspace }}/src/TestProject1/TestResults #This should be the path to your TRX files
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
##############################################################################################################################################################################################
ArtifactGenerate:
runs-on: windows-latest
needs: [build,TestUnitarios]
env:
Wap_Project_Path: src\WebApplicationDGP/WebApplicationDGP.csproj
steps:
- uses: actions/checkout@v2
- name: Publish
run: dotnet publish $env:Wap_Project_Path
- name: Show Branch NAME
run: echo ${{github.ref}}
- name: Upload WebApp Build Artifact
uses: actions/upload-artifact@v2
with:
name: WebAppDGP
path: src/WebApplicationDGP/bin/Debug/netcoreapp3.1/publish/
#############################################################################################################################################################################################