Skip to content

Commit 83807c6

Browse files
committed
update ci
1 parent 1741ba3 commit 83807c6

1 file changed

Lines changed: 31 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,66 @@ on:
99

1010
jobs:
1111
build:
12-
name: Build Wheels
13-
runs-on: ubuntu-latest
14-
12+
name: Build and Test Package
13+
runs-on: ${{ matrix.os }}
1514
strategy:
1615
matrix:
1716
python-version: ["3.8", "3.9", "3.10", "3.11"]
1817
os: [ubuntu-latest, macos-latest, windows-latest]
1918

2019
steps:
21-
# Checkout the repository
20+
# Step 1: Checkout the repository
2221
- name: Checkout Code
2322
uses: actions/checkout@v3
2423

25-
# Set up Python
24+
# Step 2: Set up Python environment
2625
- name: Set up Python ${{ matrix.python-version }}
2726
uses: actions/setup-python@v4
2827
with:
2928
python-version: ${{ matrix.python-version }}
3029

31-
# Install dependencies
30+
# Step 3: Cache Python dependencies
31+
- name: Cache Python Dependencies
32+
uses: actions/cache@v3
33+
with:
34+
path: ~/.cache/pip
35+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
36+
restore-keys: |
37+
${{ runner.os }}-pip-
38+
39+
# Step 4: Install dependencies
3240
- name: Install Build Tools
3341
run: |
3442
python -m pip install --upgrade pip setuptools wheel
3543
python -m pip install pybind11
3644
37-
# Build the wheel
45+
# Step 5: Build the wheel
3846
- name: Build Wheel
3947
run: python setup.py bdist_wheel
4048

41-
# Upload built wheels as artifacts
49+
# Step 6: Upload built wheels as artifacts
4250
- name: Upload Built Wheels
4351
uses: actions/upload-artifact@v3
4452
with:
4553
name: binaryparser-wheels
4654
path: dist/*.whl
4755

48-
# Install the built wheel
56+
# Step 7: Install the built package
4957
- name: Install Built Package
50-
run: |
51-
pip install dist/*.whl
58+
run: pip install dist/*.whl
5259

53-
54-
# Test the package (optional)
60+
# Step 8: Run tests
5561
- name: Run Tests
62+
env:
63+
PYTHONPATH: ${{ github.workspace }}
64+
run: |
65+
python -m unittest discover -s tests
66+
67+
# Optional Step: Debugging (if tests fail)
68+
- name: Show Python Environment (Debug)
69+
if: failure()
5670
run: |
57-
python ./tests/test.py
71+
python --version
72+
pip list
73+
ls -R
74+

0 commit comments

Comments
 (0)