-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #443 from GATEOverflow/mlperf-inference
Added github action for individual CM tests
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This workflow will add/update the README.md files for any updated CM scripts | ||
name: Readme update for CM scripts | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main", "mlperf-inference", "dev" ] | ||
paths: | ||
- 'script/**_cm.json' | ||
- 'script/**_cm.yml' | ||
|
||
jobs: | ||
run-script-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout' | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
- name: Get changed files | ||
id: getfile | ||
run: | | ||
echo "files=$(git diff --name-only ${{ github.event.before }} | xargs)" >> $GITHUB_OUTPUT | ||
- name: RUN Script Tests | ||
run: | | ||
echo ${{ steps.getfile.outputs.files }} | ||
for file in ${{ steps.getfile.outputs.files }}; do | ||
echo $file | ||
done | ||
python3 -m pip install cmind | ||
cm pull repo --url=https://github.com/${{ github.repository }} --checkout=${{ github.ref_name }} | ||
python3 tests/script/process_tests.py ${{ steps.getfile.outputs.files }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import sys | ||
import os | ||
import cmind as cm | ||
import check as checks | ||
import json | ||
import yaml | ||
|
||
files=sys.argv[1:] | ||
|
||
for file in files: | ||
if not os.path.isfile(file): | ||
continue | ||
if not file.endswith("_cm.json") and not file.endswith("_cm.yaml"): | ||
continue | ||
script_path = os.path.dirname(file) | ||
f = open(file) | ||
if file.endswith(".json"): | ||
data = json.load(f) | ||
elif file.endswith(".yaml"): | ||
data = yaml.safe_load(f) | ||
uid = data['uid'] | ||
|
||
r = cm.access({'action':'test', 'automation':'script', 'artifact': uid, 'quiet': 'yes'}) | ||
checks.check_return(r) |