-
Notifications
You must be signed in to change notification settings - Fork 50
42 lines (36 loc) · 1.09 KB
/
test-when-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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