Unit tests #13
Workflow file for this run
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
name: Unit tests | |
defaults: | |
run: | |
shell: bash -le {0} | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
env: | |
CUDA_DEVICE_ORDER: PCI_BUS_ID | |
jobs: | |
list-test-files: | |
runs-on: ubuntu-24.04 | |
if: github.event.inputs.m4-only != 'true' | |
outputs: | |
test-files: ${{ steps.files.outputs.test-files }} | |
steps: | |
- name: Checkout Codes | |
uses: actions/checkout@v4 | |
- name: List files | |
id: files | |
run: | | |
dir="tests" | |
json_array="[" | |
for file in "$dir"/*; do | |
[ -f "$file" ] || continue | |
filename=$(basename "$file") | |
json_array+="\"$filename\"," | |
done | |
json_array="${json_array%,}]" | |
echo "$json_array" | |
echo "test-files=$json_array" >> "$GITHUB_OUTPUT" | |
test: | |
runs-on: [ self-hosted ] | |
needs: | |
- list-test-files | |
container: | |
image: 10.0.13.31:5000/modelcloud/gptqmodel:github-ci-v5 | |
volumes: | |
- /home/ci/models:/monster/data/model | |
- /home/ci/models/huggingface:/github/home/.cache/huggingface | |
strategy: | |
fail-fast: false | |
matrix: | |
test_script: ${{ fromJSON(needs.list-test-files.outputs.test-files) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install requirements | |
run: pip install parameterized pytest | |
- name: install | |
run: pip install . | |
- name: test_pad_token | |
run: pytest tests/${{ matrix.test_script }} |