Skip to content

Feat/get-cpu-type

Feat/get-cpu-type #10

Workflow file for this run

name: Test When PR
on:
pull_request:
paths:
- swanlab/**
- test/**
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # 缓存 pip 依赖
- name: Install Dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-media.txt
pip install -r requirements-dev.txt
- name: Test
# 部分环境变量没有用到,不过后续可能会用到,所以先保留
run: |
export SWANLAB_RUNTIME=test-no-cloud
export SWANLAB_WEB_HOST=${{ secrets.SWANLAB_WEB_HOST }}
export SWANLAB_API_HOST=${{ secrets.SWANLAB_API_HOST }}
export SWANLAB_API_KEY=${{ secrets.SWANLAB_API_KEY }}
export PYTHONPATH=$PYTHONPATH:.
pytest test/unit