forked from justinyoo/ignite-spotlight-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (54 loc) · 1.6 KB
/
workflow_call_build_test_upload.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
name: 'On Called for Build & Test & Upload'
on:
workflow_call:
inputs:
artifact_name:
type: string
required: false
description: Artifact name
default: 'app'
jobs:
build_test:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.x
- name: Restore NuGet packages
shell: bash
run: |
dotnet restore .
- name: Build solution
shell: bash
run: |
dotnet build . -c Release
- name: Test solution
shell: bash
run: |
dotnet test . -c Release
- name: Create artifacts
shell: bash
run: |
dotnet publish -c Release
- name: Add app paths to env
shell: pwsh
run: |
$pathMaps = "src/MapsApi/bin/Release/net6.0/publish"
$pathWeb = "src/WebApp/bin/Release/net6.0/publish"
echo "APP_PATH_MAPS=$pathMaps" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
echo "APP_PATH_WEB=$pathWeb" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
- name: Upload app artifact - MAPS
uses: actions/upload-artifact@v2
with:
name: "${{ inputs.artifact_name }}-maps"
path: "${{ github.workspace }}/${{ env.APP_PATH_MAPS }}"
retention-days: 3
- name: Upload app artifact - WEB
uses: actions/upload-artifact@v2
with:
name: "${{ inputs.artifact_name }}-web"
path: "${{ github.workspace }}/${{ env.APP_PATH_WEB }}"
retention-days: 3