Skip to content

Merge pull request #193 from PingqiLi/main #291

Merge pull request #193 from PingqiLi/main

Merge pull request #193 from PingqiLi/main #291

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Run ut tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
ut-test:
strategy:
matrix:
os: [ubuntu-latest]
python: [3.8, 3.9]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
PYTHON_VERSION=$(python --version)
if [[ "$PYTHON_VERSION" == *"3.8"* ]]; then
pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.3.0/MindSpore/unified/x86_64/mindspore-2.3.0-cp38-cp38-linux_x86_64.whl \
--trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple
elif [[ "$PYTHON_VERSION" == *"3.9"* ]]; then
pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.3.0/MindSpore/unified/x86_64/mindspore-2.3.0-cp39-cp39-linux_x86_64.whl \
--trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple
fi
pip install -r requirements-dev.txt
- name: Lint with pre-commit
uses: pre-commit/action@v3.0.0
- name: Test with pytest
run: |
pytest tests/