Skip to content

Commit bac3fe3

Browse files
Fix CI - completely removing cache to fix issues.
Nuclear option to fix CI issues. Removing all cache to ensure that no old files are causing problems. This will result in longer build times for the next few builds, but should resolve the issues we're facing.
1 parent 198d2df commit bac3fe3

1 file changed

Lines changed: 12 additions & 16 deletions

File tree

.github/workflows/tests.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,25 @@ on:
77

88
jobs:
99
tests:
10-
if: "!contains(github.event.head_commit.message, '[skip ci]')"
1110
runs-on: ubuntu-latest
1211

1312
steps:
1413
- uses: actions/checkout@v4
1514

15+
# Nuke everything: remove cached Conda environment and Conda package cache
1616
- name: Remove existing Conda environment
1717
run: conda env remove -n hotel_management || true
1818

19-
- name: Cache Conda packages
20-
uses: actions/cache@v4
21-
with:
22-
path: ~/conda_pkgs_dir
23-
key: ${{ runner.os }}-conda-pkgs-${{ hashFiles('environment.yml') }}
24-
restore-keys: |
25-
${{ runner.os }}-conda-pkgs-
19+
- name: Remove Conda package cache
20+
run: rm -rf ~/conda_pkgs_dir || true
21+
22+
# Remove any old Python bytecode
23+
- name: Remove Python caches
24+
run: |
25+
find . -type d -name "__pycache__" -exec rm -rf {} +
26+
find . -name "*.pyc" -delete
2627
28+
# Recreate environment completely
2729
- name: Set up conda
2830
uses: conda-incubator/setup-miniconda@v2
2931
with:
@@ -33,16 +35,10 @@ jobs:
3335
use-mamba: true
3436
auto-activate-base: false
3537

36-
- name: Clear Python caches
37-
run: |
38-
find . -type d -name "__pycache__" -exec rm -rf {} +
39-
find . -name "*.pyc" -delete
40-
41-
- name: Set PYTHONPATH
42-
run: echo "PYTHONPATH=${{ github.workspace }}" >> $GITHUB_ENV
43-
38+
# Install the package in editable mode
4439
- name: Install package in editable mode
4540
run: conda run -n hotel_management pip install -e .
4641

42+
# Run tests with coverage
4743
- name: Run tests with coverage
4844
run: conda run -n hotel_management coverage run -m pytest -v --maxfail=1 --disable-warnings

0 commit comments

Comments
 (0)