-
Notifications
You must be signed in to change notification settings - Fork 14
65 lines (62 loc) · 2.08 KB
/
build-test.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
name: Build & Test
on: [pull_request, push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build builder image
run: |
builder/build_docker_image
- name: Build svr-info
run: |
builder/build
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: svr-info
path: dist/svr-info*.tgz
- name: Upload oss package
uses: actions/upload-artifact@v3
with:
name: oss_source
path: dist/oss_source.tgz
test:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: download svr-info
uses: actions/download-artifact@v3
with:
name: svr-info
- name: install jq
run: sudo apt-get install -y jq
- name: run test
run: |
tar -xf svr-info*
cd svr-info
# exercise as many options as possible
mkdir extras
cp ../.github/mock_mlc extras/mlc
mkdir output
mkdir temp
mkdir targettemp
./svr-info -temp temp -targettemp targettemp -output output -benchmark all -profile all -profile_duration 5 -profile_interval 1 -analyze all -analyze_duration 5 -analyze_frequency 5 -format all -megadata -cmd_timeout 30
# verify that the megadata directory exists
if [ ! -d output/*_megadata ]; then
echo "FAIL -- megadata directory was not created in output"
exit 1
fi
# verify that mock_mlc was run by svr-info
if [ "$( jq --raw-output '.Performance.Summary[0]."Memory Minimum Latency"' output/*.json )" != "105.5 ns" ]; then
echo "FAIL -- Memory Minimum Latency != 105.5 ns"
exit 1
fi
# TODO: add more tests here
- name: upload report
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.runner }} report
path: svr-info/output/