Skip to content

Commit 0463228

Browse files
author
andy-neuma
committed
alright some format
1 parent 190b4e5 commit 0463228

File tree

9 files changed

+148
-131
lines changed

9 files changed

+148
-131
lines changed

.github/workflows/development.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ name: Development Branch Workflow
33

44
on:
55
push:
6-
branches-ignore:
7-
- main
6+
branches-ignore: [main]
87

98
jobs:
109
quality:

.github/workflows/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ name: Main Branch Workflow
33

44
on:
55
push:
6-
branches:
7-
- main
6+
branches: [main]
87

98
jobs:
109
quality:

actions/build-ml-whl/action.yaml

Lines changed: 61 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,71 @@
1-
name: "Build Wheel"
2-
description: "Build wheel for ML repos e.g. sparseml, compressed-tensors"
1+
---
2+
name: Build Wheel
3+
description: Build wheel for ML repos e.g. sparseml, compressed-tensors
34

45
inputs:
5-
dev:
6-
description: 'If the build is a dev build'
7-
required: false
8-
default: false
9-
release:
10-
description: 'If the build is a release build'
11-
required: false
12-
default: false
13-
name:
14-
description: 'Name to append to the wheel'
15-
required: false
16-
venv:
17-
description: 'path of virtualenv if using it'
18-
required: false
6+
dev:
7+
description: If the build is a dev build
8+
required: false
9+
default: false
10+
release:
11+
description: If the build is a release build
12+
required: false
13+
default: false
14+
name:
15+
description: Name to append to the wheel
16+
required: false
17+
venv:
18+
description: path of virtualenv if using it
19+
required: false
20+
1921
outputs:
20-
whlname:
21-
description: 'wheel filename'
22-
value: ${{ steps.build.outputs.whlname }}
23-
tarname:
24-
description: 'tar.gz filename'
25-
value: ${{ steps.build.outputs.tarname }}
26-
status:
27-
description: 'status of wheel build'
28-
value: ${{ steps.build.outputs.status }}
22+
whlname:
23+
description: wheel filename
24+
value: ${{ steps.build.outputs.whlname }}
25+
tarname:
26+
description: tar.gz filename
27+
value: ${{ steps.build.outputs.tarname }}
28+
status:
29+
description: status of wheel build
30+
value: ${{ steps.build.outputs.status }}
2931

3032
# can we just pass in build args instead of updating the variables in version.py?
3133
runs:
32-
using: "composite"
34+
using: composite
3335
steps:
3436
- name: build
3537
id: build
3638
shell: bash
37-
run: |
38-
if [[ ! -z "${{ inputs.venv }}" ]]; then
39-
source ${{ inputs.venv }}/bin/activate
40-
fi
41-
pip install wheel
42-
name="${{ inputs.name }}"
43-
ver_file=$(find . -type f -name "version.py")
44-
if ${{ inputs.release }}; then
45-
sed -i 's/is_release = False/is_release = True/g' ${ver_file}
46-
sed -i 's/build_type = "dev"/build_type = "release"/g' ${ver_file}
47-
elif ${{ inputs.dev }}; then
48-
sed -i 's/is_dev = False/is_dev = True/g' ${ver_file}
49-
sed -i 's/dev_number = None/dev_number = '"$name"'/g' ${ver_file}
50-
else
51-
sed -i 's/build_type = "dev"/build_type = "nightly"/g' ${ver_file}
52-
fi
53-
status=0
54-
makefile_path=$(find . -type f -name "Makefile")
55-
cd $(dirname ${makefile_path})
56-
make -B build || status=$?
57-
ls dist/; mkdir build-results
58-
echo "
59-
<testsuites>
60-
<testsuite errors=\"$status\" failures=\"$status\" name=\"build\" skipped=\"0\" tests=\"1\">
61-
<testcase classname=\"build\"/>
62-
</testsuite>
63-
</testsuites>" > build-results/result.xml
64-
echo "=========== Build log ==========="
65-
echo "$status"
66-
echo "whlname=$(find dist -name '*.whl' -exec basename {} \;)" >> "$GITHUB_OUTPUT"
67-
echo "tarname=$(find dist -name '*.tar.gz' -exec basename {} \;)" >> "$GITHUB_OUTPUT"
68-
echo "status=${status}" >> "$GITHUB_OUTPUT"
69-
exit ${status}
39+
run: |-
40+
if [[ ! -z "${{ inputs.venv }}" ]]; then
41+
source ${{ inputs.venv }}/bin/activate
42+
fi
43+
pip install wheel
44+
name="${{ inputs.name }}"
45+
ver_file=$(find . -type f -name "version.py")
46+
if ${{ inputs.release }}; then
47+
sed -i 's/is_release = False/is_release = True/g' ${ver_file}
48+
sed -i 's/build_type = "dev"/build_type = "release"/g' ${ver_file}
49+
elif ${{ inputs.dev }}; then
50+
sed -i 's/is_dev = False/is_dev = True/g' ${ver_file}
51+
sed -i 's/dev_number = None/dev_number = '"$name"'/g' ${ver_file}
52+
else
53+
sed -i 's/build_type = "dev"/build_type = "nightly"/g' ${ver_file}
54+
fi
55+
status=0
56+
makefile_path=$(find . -type f -name "Makefile")
57+
cd $(dirname ${makefile_path})
58+
make -B build || status=$?
59+
ls dist/; mkdir build-results
60+
echo "
61+
<testsuites>
62+
<testsuite errors=\"$status\" failures=\"$status\" name=\"build\" skipped=\"0\" tests=\"1\">
63+
<testcase classname=\"build\"/>
64+
</testsuite>
65+
</testsuites>" > build-results/result.xml
66+
echo "=========== Build log ==========="
67+
echo "$status"
68+
echo "whlname=$(find dist -name '*.whl' -exec basename {} \;)" >> "$GITHUB_OUTPUT"
69+
echo "tarname=$(find dist -name '*.tar.gz' -exec basename {} \;)" >> "$GITHUB_OUTPUT"
70+
echo "status=${status}" >> "$GITHUB_OUTPUT"
71+
exit ${status}

actions/create-virtualenv/action.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1+
---
12
name: create virtualenv
2-
description: 'create virtualenv using input name'
3+
description: create virtualenv using input name
4+
35
inputs:
46
venv:
5-
description: 'name of virtualenv'
7+
description: name of virtualenv
68
required: true
9+
710
outputs:
811
penv:
9-
description: 'path of the created virtualenv'
12+
description: path of the created virtualenv
1013
value: ${{ steps.env.outputs.penv }}
14+
1115
runs:
1216
using: composite
1317
steps:
14-
- id: env
15-
run: |
16-
# install virtualenv
17-
python -m pip install virtualenv
18-
python -m virtualenv ${{ inputs.venv }}
19-
pwd; ls -al
20-
echo "penv=$(pwd)/${{ inputs.venv }}" >> "$GITHUB_OUTPUT"
21-
shell: bash
22-
18+
- id: env
19+
run: |
20+
# install virtualenv
21+
python -m pip install virtualenv
22+
python -m virtualenv ${{ inputs.venv }}
23+
pwd; ls -al
24+
echo "penv=$(pwd)/${{ inputs.venv }}" >> "$GITHUB_OUTPUT"
25+
shell: bash

actions/install-whl/action.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
---
12
name: install whl
2-
description: 'installs found whl based on python version into specified venv'
3+
description: installs found whl based on python version into specified venv
4+
35
inputs:
46
venv:
5-
description: "path of virtualenv"
7+
description: path of virtualenv
68
required: true
79
name:
8-
description: "name contained in the whl name, e.g. llmcompressor, compressed_tensors etc"
10+
description: name contained in the whl name, e.g. llmcompressor, compressed_tensors etc
911
required: true
1012
extra:
11-
description: "extra dependency of the whl to install"
13+
description: extra dependency of the whl to install
1214
required: false
15+
1316
runs:
1417
using: composite
1518
steps:

actions/set-python/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Set Python With Pyenv
23
description: Sets the Python version with pyenv and creates a virtual environment
34

actions/summary-build/action.yml

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
1+
---
12
name: build summary
2-
description: 'creates a GHA run summary'
3+
description: creates a GHA run summary
4+
35
inputs:
46
label:
5-
description: 'GHA runner label'
7+
description: GHA runner label
68
required: true
79
gitref:
8-
description: 'git commit hash or branch name'
10+
description: git commit hash or branch name
911
required: true
1012
whl_status:
11-
description: 'status from build step'
13+
description: status from build step
1214
required: true
15+
1316
runs:
1417
using: composite
1518
steps:
16-
- run: |
17-
if [ ${{ inputs.whl_status }} -eq 0 ]; then
18-
# green check
19-
WHL_EMOJI=$(echo -e "\xE2\x9C\x85")
20-
else
21-
# red x
22-
WHL_EMOJI=$(echo -e "\xE2\x9D\x8C")
23-
fi
24-
echo ""
25-
echo "| Parameter | |" >> $GITHUB_STEP_SUMMARY
26-
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
27-
echo "| label: | \`${{ inputs.label }}\` |" >> $GITHUB_STEP_SUMMARY
28-
echo "| git sha: | \`${{ github.sha }}\` |" >> $GITHUB_STEP_SUMMARY
29-
echo "| github actor: | '${{ github.actor }}' |" >> $GITHUB_STEP_SUMMARY
30-
echo "| gitref: | '${{ inputs.gitref }}' |" >> $GITHUB_STEP_SUMMARY
31-
echo "| whl: | ${WHL_EMOJI} |" >> $GITHUB_STEP_SUMMARY
32-
shell: bash
19+
- run: |
20+
if [ ${{ inputs.whl_status }} -eq 0 ]; then
21+
# green check
22+
WHL_EMOJI=$(echo -e "\xE2\x9C\x85")
23+
else
24+
# red x
25+
WHL_EMOJI=$(echo -e "\xE2\x9D\x8C")
26+
fi
27+
echo ""
28+
echo "| Parameter | |" >> $GITHUB_STEP_SUMMARY
29+
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
30+
echo "| label: | \`${{ inputs.label }}\` |" >> $GITHUB_STEP_SUMMARY
31+
echo "| git sha: | \`${{ github.sha }}\` |" >> $GITHUB_STEP_SUMMARY
32+
echo "| github actor: | '${{ github.actor }}' |" >> $GITHUB_STEP_SUMMARY
33+
echo "| gitref: | '${{ inputs.gitref }}' |" >> $GITHUB_STEP_SUMMARY
34+
echo "| whl: | ${WHL_EMOJI} |" >> $GITHUB_STEP_SUMMARY
35+
shell: bash

actions/summary-test/action.yml

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,48 @@
1+
---
12
name: test summary
2-
description: 'creates a neuralmagic GHA run summary'
3+
description: creates a neuralmagic GHA run summary
4+
35
inputs:
46
test_label:
5-
description: 'GHA runner label'
7+
description: GHA runner label
68
required: true
79
gitref:
8-
description: 'git commit hash or branch name'
10+
description: git commit hash or branch name
911
required: true
1012
testmo_run_url:
11-
description: 'testmo URL for this particular run'
13+
description: testmo URL for this particular run
1214
required: true
1315
python:
14-
description: 'python version info'
16+
description: python version info
1517
required: true
1618
whl:
17-
description: 'whl file tested'
19+
description: whl file tested
1820
required: true
1921
test_status:
20-
description: 'status from test step'
22+
description: status from test step
2123
required: true
24+
2225
runs:
2326
using: composite
2427
steps:
25-
- run: |
26-
if [ ${{ inputs.test_status }} -eq 0 ]; then
27-
# green check
28-
TEST_EMOJI=$(echo -e "\xE2\x9C\x85")
29-
else
30-
# red x
31-
TEST_EMOJI=$(echo -e "\xE2\x9D\x8C")
32-
fi
33-
echo "| Parameter | |" >> $GITHUB_STEP_SUMMARY
34-
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
35-
echo "| label: | \`${{ inputs.test_label }}\` |" >> $GITHUB_STEP_SUMMARY
36-
echo "| git sha: | \`${{ github.sha }}\` |" >> $GITHUB_STEP_SUMMARY
37-
echo "| github actor: | '${{ github.actor }}' |" >> $GITHUB_STEP_SUMMARY
38-
echo "| gitref: | '${{ inputs.gitref }}' |" >> $GITHUB_STEP_SUMMARY
39-
echo "| branch name: | '${{ github.ref_name }}' |" >> $GITHUB_STEP_SUMMARY
40-
echo "| python: | ${{ inputs.python }} |" >> $GITHUB_STEP_SUMMARY
41-
echo "| whl: | ${{ inputs.whl }} |" >> $GITHUB_STEP_SUMMARY
42-
echo "| test: | ${TEST_EMOJI} |" >> $GITHUB_STEP_SUMMARY
43-
echo "" >> $GITHUB_STEP_SUMMARY
44-
echo "#### TestMo URL: ${{ inputs.testmo_run_url }}" >> $GITHUB_STEP_SUMMARY
45-
shell: bash
28+
- run: |
29+
if [ ${{ inputs.test_status }} -eq 0 ]; then
30+
# green check
31+
TEST_EMOJI=$(echo -e "\xE2\x9C\x85")
32+
else
33+
# red x
34+
TEST_EMOJI=$(echo -e "\xE2\x9D\x8C")
35+
fi
36+
echo "| Parameter | |" >> $GITHUB_STEP_SUMMARY
37+
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
38+
echo "| label: | \`${{ inputs.test_label }}\` |" >> $GITHUB_STEP_SUMMARY
39+
echo "| git sha: | \`${{ github.sha }}\` |" >> $GITHUB_STEP_SUMMARY
40+
echo "| github actor: | '${{ github.actor }}' |" >> $GITHUB_STEP_SUMMARY
41+
echo "| gitref: | '${{ inputs.gitref }}' |" >> $GITHUB_STEP_SUMMARY
42+
echo "| branch name: | '${{ github.ref_name }}' |" >> $GITHUB_STEP_SUMMARY
43+
echo "| python: | ${{ inputs.python }} |" >> $GITHUB_STEP_SUMMARY
44+
echo "| whl: | ${{ inputs.whl }} |" >> $GITHUB_STEP_SUMMARY
45+
echo "| test: | ${TEST_EMOJI} |" >> $GITHUB_STEP_SUMMARY
46+
echo "" >> $GITHUB_STEP_SUMMARY
47+
echo "#### TestMo URL: ${{ inputs.testmo_run_url }}" >> $GITHUB_STEP_SUMMARY
48+
shell: bash

actions/verify-python/action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1+
---
12
name: verify python
2-
description: 'verify env python version if matching the expected version'
3+
description: verify env python version if matching the expected version
4+
35
inputs:
46
python-version:
5-
description: "version of python to verify, e.g. 3.10"
7+
description: version of python to verify, e.g. 3.10
68
required: true
9+
710
outputs:
811
version:
9-
description: "result from 'python --version'"
12+
description: result from 'python --version'
1013
value: ${{ steps.env_python.outputs.version }}
14+
1115
runs:
1216
using: composite
1317
steps:

0 commit comments

Comments
 (0)