|
| 1 | +name: test |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +permissions: read-all |
| 6 | + |
| 7 | +jobs: |
| 8 | + test: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] |
| 13 | + steps: |
| 14 | + - name: 'Checkout' |
| 15 | + uses: actions/checkout@v4 |
| 16 | + - name: 'Set up Python ${{ matrix.python-version }}' |
| 17 | + uses: actions/setup-python@v5 |
| 18 | + with: |
| 19 | + python-version: ${{ matrix.python-version }} |
| 20 | + - name: 'Install variantlib' |
| 21 | + run: | |
| 22 | + # aligning version if variantlib with the one used in this project: |
| 23 | + # * https://github.com/wheelnext/pep_xxx_wheel_variants |
| 24 | + python3 -m pip install git+https://github.com/wheelnext/variantlib@008ba22 |
| 25 | + - name: 'Install project' |
| 26 | + run: | |
| 27 | + python3 --version |
| 28 | + python3 -m pip install -e . |
| 29 | + python3 -m pip install -e ".[test]" |
| 30 | + - name: 'Run pytest' |
| 31 | + run: | |
| 32 | + python3 -m pytest tests/ |
| 33 | + - name: 'Test variantlib plugins list' |
| 34 | + run: | |
| 35 | + variantlib plugins list >_list.txt |
| 36 | + grep xpu _list.txt |
| 37 | + - name: 'Test variantlib plugins get-supported-configs' |
| 38 | + run: | |
| 39 | + variantlib plugins get-supported-configs >_configs.txt |
| 40 | + # File should be empty as runner does not have intel gpu |
| 41 | + test ! -s _configs.txt |
| 42 | + - name: 'Test variantlib plugins validate-property' |
| 43 | + run: | |
| 44 | + variantlib plugins validate-property "xpu::device_ip::12.55.8" >_props.txt |
| 45 | + grep " valid" _props.txt |
| 46 | + variantlib plugins validate-property "xpu::device_ip::0.0.0" >_props.txt |
| 47 | + grep invalid _props.txt |
| 48 | + variantlib plugins validate-property "xpu::nosuchprop::12.55.8" >_props.txt |
| 49 | + grep invalid _props.txt |
0 commit comments