Skip to content

Merge pull request #38 from intel/prep2111 #120

Merge pull request #38 from intel/prep2111

Merge pull request #38 from intel/prep2111 #120

Workflow file for this run

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/