-
-
Notifications
You must be signed in to change notification settings - Fork 9
55 lines (53 loc) 路 1.88 KB
/
Copy pathbuild.yml
File metadata and controls
55 lines (53 loc) 路 1.88 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Build + tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Build and Install Package, Run Tests - ${{ matrix.os }}
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
include:
- os: ubuntu
runs-on: ubuntu-latest
- os: ubuntu-22.04
runs-on: ubuntu-22.04
- os: windows
runs-on: windows-latest
- os: macos
runs-on: macos-latest
env:
TEST_SINGBOX_LINK: ${{ secrets.TEST_SINGBOX_LINK }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel pytest pytest-asyncio
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
- name: Build the Package
run: |
python -m pip install -e .
- name: Run Tests
run: |
python -m pytest tests/ --tb=short --disable-warnings --ignore=tests/tun_test.py
- name: Run TUN config tests
run: |
python -m pytest tests/tun_test.py::TestTunConfig --tb=short --disable-warnings -v
- name: Run TUN live test (Linux)
if: runner.os == 'Linux' && env.TEST_SINGBOX_LINK != ''
run: |
sudo -E env "PATH=$PATH" "TEST_SINGBOX_LINK=$TEST_SINGBOX_LINK" "$pythonLocation/bin/python" -m pytest tests/tun_test.py::TestTunLiveSystemVpn --tb=short --disable-warnings -v
- name: Run TUN live test (Windows)
if: runner.os == 'Windows' && env.TEST_SINGBOX_LINK != ''
run: |
python -m pytest tests/tun_test.py::TestTunLiveSystemVpn --tb=short --disable-warnings -v