|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main, develop ] |
| 6 | + pull_request: |
| 7 | + branches: [ main, develop ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + test: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + timeout-minutes: 30 |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + python-version: ["3.9", "3.10", "3.11"] |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + with: |
| 20 | + submodules: recursive |
| 21 | + |
| 22 | + - name: Set up Python ${{ matrix.python-version }} |
| 23 | + uses: actions/setup-python@v4 |
| 24 | + with: |
| 25 | + python-version: ${{ matrix.python-version }} |
| 26 | + |
| 27 | + - name: Set up conda |
| 28 | + uses: conda-incubator/setup-miniconda@v3 |
| 29 | + with: |
| 30 | + auto-update-conda: true |
| 31 | + python-version: ${{ matrix.python-version }} |
| 32 | + |
| 33 | + - name: Cache conda dependencies |
| 34 | + uses: actions/cache@v3 |
| 35 | + with: |
| 36 | + path: | |
| 37 | + ~/conda_pkgs_dir |
| 38 | + ${{ env.CONDA }}/envs/test-env-${{ matrix.python-version }} |
| 39 | + key: ${{ runner.os }}-conda-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt', '**/pyproject.toml', '**/requirements.in') }} |
| 40 | + restore-keys: | |
| 41 | + ${{ runner.os }}-conda-${{ matrix.python-version }}- |
| 42 | + ${{ runner.os }}-conda- |
| 43 | +
|
| 44 | + - name: Install dependencies |
| 45 | + run: | |
| 46 | + conda install -c conda-forge open3d>=0.17.0 -y |
| 47 | + python -m pip install --upgrade pip |
| 48 | + pip install -r requirements.txt |
| 49 | + pip install -e ml-sharp/ |
| 50 | +
|
| 51 | + - name: Create required directories |
| 52 | + run: | |
| 53 | + mkdir -p inputs/input_images |
| 54 | + mkdir -p outputs/output_gaussians |
| 55 | + mkdir -p models |
| 56 | +
|
| 57 | + - name: Basic syntax and import check |
| 58 | + run: | |
| 59 | + # Check Python syntax for all Python files |
| 60 | + find . -name "*.py" -not -path "./venv/*" -not -path "./ml-sharp/*" -exec python -m py_compile {} \; |
| 61 | +
|
| 62 | + # Test basic imports |
| 63 | + python -c "import sys; sys.path.insert(0, 'src'); import aylm; print('✅ Main package imports successfully')" |
| 64 | + python -c "import scripts.coordinate_utils; print('✅ coordinate_utils imports successfully')" |
| 65 | + python -c "import scripts.pointcloud_voxelizer; print('✅ pointcloud_voxelizer imports successfully')" |
| 66 | + python -c "import scripts.preload_sharp_model; print('✅ preload_sharp_model imports successfully')" |
| 67 | +
|
| 68 | + - name: Test script functionality |
| 69 | + run: | |
| 70 | + # Test help commands |
| 71 | + python scripts/preload_sharp_model.py --help || exit 1 |
| 72 | + python scripts/pointcloud_voxelizer.py --help || exit 1 |
| 73 | + python scripts/coordinate_utils.py --help 2>/dev/null || echo "coordinate_utils may not have help" |
| 74 | +
|
| 75 | + # Test CLI entry points |
| 76 | + python -m aylm.cli --help || exit 1 |
| 77 | +
|
| 78 | + build: |
| 79 | + runs-on: ubuntu-latest |
| 80 | + needs: test |
| 81 | + |
| 82 | + steps: |
| 83 | + - uses: actions/checkout@v4 |
| 84 | + with: |
| 85 | + submodules: recursive |
| 86 | + |
| 87 | + - name: Set up Python |
| 88 | + uses: actions/setup-python@v4 |
| 89 | + with: |
| 90 | + python-version: "3.9" |
| 91 | + |
| 92 | + - name: Install build dependencies |
| 93 | + run: | |
| 94 | + python -m pip install --upgrade pip |
| 95 | + pip install build twine |
| 96 | +
|
| 97 | + - name: Build package |
| 98 | + run: python -m build |
| 99 | + |
| 100 | + - name: Check package |
| 101 | + run: | |
| 102 | + python -m twine check dist/* |
| 103 | +
|
| 104 | + - name: Upload build artifacts |
| 105 | + uses: actions/upload-artifact@v4 |
| 106 | + with: |
| 107 | + name: dist |
| 108 | + path: dist/ |
0 commit comments