|
12 | 12 |
|
13 | 13 | jobs: |
14 | 14 | build: |
15 | | - runs-on: ubuntu-latest # Or 'macos-latest', 'windows-latest' if your tests require a specific OS |
| 15 | + runs-on: ubuntu-latest |
16 | 16 |
|
17 | 17 | steps: |
18 | 18 | - name: Checkout repository |
19 | | - # Checks out your repository under $GITHUB_WORKSPACE, so your workflow can access it. |
20 | 19 | uses: actions/checkout@v4 |
21 | 20 |
|
22 | 21 | - name: Set up Python |
23 | | - # Sets up a Python environment. You can specify a version (e.g., '3.9', '3.10', '3.11'). |
24 | 22 | uses: actions/setup-python@v5 |
25 | 23 | with: |
26 | | - python-version: '3.11' # Ensure this matches your development environment or a compatible version |
| 24 | + python-version: '3.11' |
| 25 | + cache: 'pip' # Enable caching to speed up future runs |
27 | 26 |
|
28 | 27 | - name: Install dependencies |
29 | | - # Install project dependencies from requirements.txt |
30 | 28 | run: | |
31 | 29 | python -m pip install --upgrade pip |
| 30 | + |
| 31 | + # --- FIX FOR DISK SPACE ERROR --- |
| 32 | + # Install CPU-only versions of PyTorch first (saves ~3GB) |
| 33 | + # We must install torch, torchvision, and torchaudio from the CPU index |
| 34 | + pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu |
| 35 | + # ------------------------------- |
| 36 | +
|
| 37 | + # Now install the rest of the requirements |
| 38 | + # (Pip will see torch is already installed and skip the huge download) |
32 | 39 | pip install -r requirements.txt |
33 | | - # Install tqdm explicitly if it's used but not in requirements.txt (as discussed) |
| 40 | + |
| 41 | + # Install explicit dependencies if needed |
34 | 42 | pip install tqdm |
35 | 43 |
|
36 | 44 | - name: Run Unit Tests |
37 | | - # Discover and run all tests in the 'tests' directory. |
38 | 45 | run: | |
39 | 46 | python -m unittest discover tests |
0 commit comments