-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (128 loc) · 4.52 KB
/
build_and_test.yaml
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
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: 'Build & Test'
on:
#push:
# branches: [ "master" ]
workflow_dispatch:
env:
TZ: America/Chicago
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
#
- name: Restore dependencies
run: dotnet restore
#
- name: 'Build / Publish'
#run: dotnet build
working-directory: ./src/PlotGitHubAction
run: |
dotnet publish \
--configuration Release \
--runtime linux-x64 \
--no-self-contained \
-o ../../built
ls -lah ../../built
#
# SETUP TEST DATA
#
- name: 'Copy csproj to test-data'
run: |
mkdir -p ./test-src/gh-action-plot
cp ./src/PlotGitHubAction/*.cs* ./test-src/gh-action-plot
- name: 'Build to generate build warnings log file: gh-action-plot'
working-directory: ./test-src/gh-action-plot
if: ${{ ! always() }}
run: |
dotnet restore
dotnet build \
--no-restore \
--configuration Release \
-consoleloggerparameters:"Summary;Verbosity=normal" \
-m \
-t:"clean,build" \
-fl1 "/flp1:logFile=gh-action-plot-build.log;warningsonly" \
-p:"WarnLevel=5"
#
- uses: actions/checkout@v3
with:
repository: 'erichiller/mkmrk.Channels'
path: 'test-src/mkmrk-channels'
#
- name: 'Build to generate build warnings log file: mkmrk.Channels'
if: ${{ ! always() }}
working-directory: ./test-src/mkmrk-channels
run: |
dotnet restore
dotnet build \
--no-restore \
--configuration Release \
-consoleloggerparameters:"Summary;Verbosity=normal" \
-m \
-t:"clean,build" \
-fl1 "/flp1:logFile=mkmrk-channels-build.log;warningsonly" \
-p:"WarnLevel=5"
#
- name: 'Move sample -build.log'
run: |
cp ./sample/mkmrk-channels-build.log ./test-src/mkmrk-channels/src/mkmrk.Channels/
mv ./sample/mkmrk-channels-build.log ./test-src/mkmrk-channels/src/mkmrk.Channels/copy-of-mkmrk-channels-build.log
- name: Get mkmrk-channels Coverage History
working-directory: ./test-src/mkmrk-channels/
run: |
pwd
mkdir -p ./docs/coverage/history/
mkdir -p ./test-dir/output
ls -la
wget http://www.hiller.pro/mkmrk.Channels/coverage/history/coverage-history.zip
unzip coverage-history.zip -d ./docs/coverage/history/
ls -la ./docs/coverage/history/
#
- name: Create test plot json
#if: ${{ ! always() }}
shell: pwsh
run: |
Write-Output (Get-Date -Date "2020-01-01T00:00:00" ).ToOADate()
New-Item -Type Directory -Path './test-dir'
Set-Content -Path "./test-dir/test_json_file_plot_config_1.json" -Value '{ "Title": "Test plot from File", "OutputFileName": "test_json_file_plot.png", "PlotType": "Scatter", "Width": 800, "Height": 600, "Data": [ { "Title": "Series A", "X": [ 11, 52, 19 ], "Y": [ 57, 54, 31 ] } ]}'
#
- name: 'Move src directory'
run: |
# try having a different directory than what will be in the build log
mv ./test-src/mkmrk-channels ./test-src/mkmrk-channels-diff-pos
- name: 'Run local build of gh-action-plot'
env:
#INPUT_SOURCE_SCAN_DIR: './'
INPUT_SOURCE_SCAN_DIR: './test-src/'
INPUT_PLOT_DEFINITIONS_DIR: './test-dir'
INPUT_OUTPUT_DIR: './test-dir/output'
INPUT_TEST_RESULTS_DIR: './'
INPUT_COVERAGE_HISTORY_DIR: './mkmrk-channels/docs/coverage/history/'
run: |
built/PlotGitHubAction
#
#- name: Build
# run: dotnet run --no-restore -- './'
#
- name: List Output
shell: pwsh
run: |
Get-ChildItem -Recurse -Path ./ | Select-Object -Property Name,CreationTime,Size
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: plot-results
retention-days: 1
path: |
./test-dir/
./**/*-build.log
./test-src/mkmrk-channels/.git
.git/**
#*.png
#if: ${{ failure() }}