@@ -7,59 +7,68 @@ permissions:
77
88jobs :
99 build :
10- runs-on : ubuntu-latest
10+ runs-on : ${{ matrix.os }}
11+ strategy :
12+ matrix :
13+ os : [ubuntu-latest, macos-latest, macos-14]
14+ python-version : ['3.9', '3.10', '3.11', '3.12', '3.13']
15+
1116 steps :
1217 - uses : actions/checkout@v4
18+ with :
19+ submodules : recursive
1320
14- - name : Set up Python
15- uses : actions /setup-python @v4
21+ - name : Install uv
22+ uses : astral-sh /setup-uv @v4
1623 with :
17- python- version : " 3.10 "
24+ version : " latest "
1825
19- - name : Init submodules
20- run : git submodule update --init --recursive
26+ - name : Set up Python ${{ matrix.python-version }}
27+ run : uv python install ${{ matrix.python-version }}
2128
22- - name : Prepare
23- run : bash src/libCacheSim/scripts/install_dependency.sh
29+ - name : Install system dependencies (Ubuntu)
30+ if : matrix.os == 'ubuntu-latest'
31+ run : |
32+ sudo apt-get update
33+ sudo apt-get install -y pkg-config libglib2.0-dev libzstd-dev
2434
25- - name : Build main libCacheSim project
35+ - name : Install system dependencies (macOS)
36+ if : matrix.os == 'macos-latest' || matrix.os == 'macos-14'
2637 run : |
27- pushd src/libCacheSim
28- cmake -G Ninja -B build
29- ninja -C build
30- popd
38+ brew install glib pkg-config zstd argp-standalone
3139
32- - name : Build libCacheSim-python
40+ - name : Build and test with uv
3341 run : |
34- pip install -e .[dev]
42+ uv venv --python ${{ matrix.python-version }}
43+ uv pip install -e .[dev]
44+ uv run python -c "import libcachesim; print('✓ Import successful for Python ${{ matrix.python-version }} on ${{ matrix.os }}')"
3545
3646 - name : Run tests
3747 run : |
38- python -m pytest tests/
48+ if [ -d "tests" ]; then
49+ uv run python -m pytest tests/ -v
50+ else
51+ echo "No tests directory found, skipping tests"
52+ fi
3953
4054 docs :
4155 runs-on : ubuntu-latest
4256 steps :
4357 - uses : actions/checkout@v4
4458
45- - name : Set up Python
46- uses : actions /setup-python @v4
59+ - name : Install uv
60+ uses : astral-sh /setup-uv @v4
4761 with :
48- python- version : " 3.x "
62+ version : " latest "
4963
50- - name : Cache dependencies
51- uses : actions/cache@v3
52- with :
53- path : ~/.cache/pip
54- key : ${{ runner.os }}-pip-docs-${{ hashFiles('docs/requirements.txt') }}
55- restore-keys : |
56- ${{ runner.os }}-pip-docs-
64+ - name : Set up Python
65+ run : uv python install 3.11
5766
58- - name : Install documentation dependencies
67+ - name : Install documentation dependencies and build
5968 run : |
69+ # Install MkDocs and dependencies using pip in a temporary venv
70+ python3 -m venv temp-docs-env
71+ source temp-docs-env/bin/activate
6072 pip install -r docs/requirements.txt
61-
62- - name : Test documentation build
63- run : |
6473 cd docs
6574 mkdocs build --clean --strict
0 commit comments