Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
dhuangnm authored and dhuangnm committed Sep 12, 2024
1 parent 5f6bea7 commit 949e456
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 15 deletions.
31 changes: 31 additions & 0 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: test compressed-tensors
description: 'test compressed-tensors'
inputs:
venv:
description: "path of virtualenv"
required: true
outputs:
status:
description: "final status from test"
value: ${{ steps.test.outputs.status }}
runs:
using: composite
steps:
- id: test
run: |
# install wheel
source ${{ inputs.venv }}/bin/activate
python --version
WHL=$(find . -type f -iname "compressed*.whl")
pip install ${WHL}[dev,accelerate]
version=$(pip freeze | grep compressed)
echo "installed ${version}"
SUCCESS=0
# run test
echo "running tests..."
rm -rf src
make test || SUCCESS=$?
echo "status=${SUCCESS}" >> "$GITHUB_OUTPUT"
deactivate
exit ${SUCCESS}
shell: bash
30 changes: 15 additions & 15 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@ jobs:
timeout: 20
secrets: inherit

# TEST:
# needs: [BUILD]
# strategy:
# fail-fast: false
# matrix:
# test_config: ${{ fromJson(inputs.test_configs) }}
# uses: ./.github/workflows/test.yml
# with:
# gitref: ${{ inputs.gitref }}
# test_label: ${{ matrix.test_config.label }}
# python: ${{ matrix.test_config.python }}
# timeout: ${{ matrix.test_config.timeout }}
# whl: ${{ needs.BUILD.outputs.whl }}
# testmo_run_id: ${{ needs.BUILD.outputs.testmo_run_id }}
# secrets: inherit
TEST:
needs: [BUILD]
strategy:
fail-fast: false
matrix:
test_config: ${{ fromJson(inputs.test_configs) }}
uses: ./.github/workflows/test.yml
with:
gitref: ${{ inputs.gitref }}
test_label: ${{ matrix.test_config.label }}
python: ${{ matrix.test_config.python }}
timeout: ${{ matrix.test_config.timeout }}
whl: ${{ needs.BUILD.outputs.whl }}
testmo_run_id: ${{ needs.BUILD.outputs.testmo_run_id }}
secrets: inherit

# UPLOAD:
# needs: TEST
Expand Down

0 comments on commit 949e456

Please sign in to comment.