This repository has been archived by the owner on Dec 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
65 lines (61 loc) · 2.3 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]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Build svr-info
run: |
builder/build
- name: Upload build
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: svr-info
path: dist/svr-info*.tgz
- name: Upload oss package
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: oss_source
path: dist/oss_source.tgz
test:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: download svr-info
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: ${{ matrix.runner }} report
path: svr-info/output/