-
Notifications
You must be signed in to change notification settings - Fork 10
140 lines (137 loc) · 4.89 KB
/
pr-workflow.yml
File metadata and controls
140 lines (137 loc) · 4.89 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Pull Request
on: [pull_request]
env:
LINUX_VERBOSE_LOGGING: false # set to true to enable verbose log output
WINDOWS_VERBOSE_LOGGING: false # set to true to enable verbose log output
MACOS_VERBOSE_LOGGING: false # set to true to enable verbose log output
jobs:
linux_build:
name: 'Linux Build'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Output Verbose Logging for Linux
run: echo $LINUX_VERBOSE_LOGGING
- name: Setup Commands
run: chmod +x ./scripts/download-latest.sh
- name: Configure Nuget
run: sed -i 's/GITHUB_TOKEN/${{ secrets.GITHUB_TOKEN }}/g' nuget.config
- name: DotNet and Nuget Locals Info
if: env.LINUX_VERBOSE_LOGGING == 'true'
run: |
dotnet --info
dotnet nuget locals all --list
- name: Build and Package
run: |
commit="${{ github.sha }}"
[[ $LINUX_VERBOSE_LOGGING = true ]] && addl_params="-v diag > build.log" || addl_params=""
command="dotnet build -c Release --version-suffix ""${commit:0:7}"" $addl_params"
eval $command
- name: Test
run: dotnet test -c Release
- name: Upload Linux artifacts
uses: actions/upload-artifact@v1
with:
name: Linux-Release
path: src/ElectionGuard/bin/Release
- name: Upload Linux intermediate artifacts
if: env.LINUX_VERBOSE_LOGGING == 'true'
uses: actions/upload-artifact@v1
with:
name: Linux-Intermediates
path: src/ElectionGuard/obj/Release
- name: Upload Linux build log
if: env.LINUX_VERBOSE_LOGGING == 'true'
uses: actions/upload-artifact@v1
with:
name: Linux-build.log
path: build.log
windows_build:
name: 'Windows Build'
runs-on: 'windows-latest'
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Output Verbose Logging for Windows
run: Write-Host $Env:WINDOWS_VERBOSE_LOGGING
- name: Configure Nuget
run: ((Get-Content -path nuget.config -Raw) -replace 'GITHUB_TOKEN','${{ secrets.GITHUB_TOKEN }}') | Set-Content -Path nuget.config
- name: DotNet and Nuget Locals Info
if: env.WINDOWS_VERBOSE_LOGGING == 'true'
run: |
dotnet --info
dotnet nuget locals all --list
- name: Build and Package
run: |
$command = "dotnet build -c Release --version-suffix (""${{ github.sha }}"".Substring(0,7))"
if ($Env:WINDOWS_VERBOSE_LOGGING -eq 'true') { $command = $command + " -v diag > build.log" }
Write-Host $command
Invoke-Expression $command
- name: Test
run: dotnet test -c Release
- name: Upload Windows artifacts
uses: actions/upload-artifact@v1
with:
name: Windows-Release
path: src/ElectionGuard/bin/Release
- name: Upload Windows intermediate artifacts
if: env.WINDOWS_VERBOSE_LOGGING == 'true'
uses: actions/upload-artifact@v1
with:
name: Windows-Intermediates
path: src/ElectionGuard/obj/Release
- name: Upload Windows build log
if: env.WINDOWS_VERBOSE_LOGGING == 'true'
uses: actions/upload-artifact@v1
with:
name: Windows-build.log
path: build.log
macos_build:
name: 'MacOS Build'
runs-on: 'macOS-latest'
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Output Verbose Logging for MacOS
run: echo $MACOS_VERBOSE_LOGGING
- name: Upgrade dotnet core sdk
run: brew cask install dotnet-sdk
- name: Setup Commands
run: chmod +x ./scripts/download-latest.sh
- name: Configure Nuget
run: sed -i '' 's/GITHUB_TOKEN/${{ secrets.GITHUB_TOKEN }}/' nuget.config
- name: DotNet and Nuget Locals Info
if: env.MACOS_VERBOSE_LOGGING == 'true'
run: |
dotnet --info
dotnet nuget locals all --list
- name: Build and Package
run: |
commit="${{ github.sha }}"
[[ $MACOS_VERBOSE_LOGGING = true ]] && addl_params="-v diag > build.log" || addl_params=""
command="dotnet build -c Release --version-suffix ""${commit:0:7}"" $addl_params"
eval $command
- name: Test
if: false #disable
run: dotnet test -c Release
- name: Upload MacOS artifacts
uses: actions/upload-artifact@v1
with:
name: MacOS-Release
path: src/ElectionGuard/bin/Release
- name: Upload MacOS intermediate artifacts
if: env.MACOS_VERBOSE_LOGGING == 'true'
uses: actions/upload-artifact@v1
with:
name: MacOS-Intermediates
path: src/ElectionGuard/obj/Release
- name: Upload MacOS build log
if: env.MACOS_VERBOSE_LOGGING == 'true'
uses: actions/upload-artifact@v1
with:
name: MacOS-build.log
path: build.log