Skip to content

Commit

Permalink
Fix pip Cache in Github action (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
JosselinSomervilleRoberts authored Feb 15, 2024
1 parent d590dd3 commit b40ac4e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ jobs:
matrix:
python-version: ["3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements.txt') }}-${{ matrix.python-version }}
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Run static code checks
run: source venv/bin/activate && ./pre-commit.sh
- name: Collect 10 webpages
run: source venv/bin/activate && image2structure-collect --category html --num-instances 10 webpage --timeout 30 --port 4000 --max_size_kb 100
run: source venv/bin/activate && image2structure-collect --category html --num-instances 5 webpage --timeout 30 --port 4000 --max_size_kb 100

test:
name: Run all tests
Expand All @@ -54,16 +54,16 @@ jobs:
run: |
sudo rm -rf /opt/ghc
df -h
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements.txt') }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update-requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:
python-version: ["3.9"]
steps:
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Load pip cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements.txt') }}-${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion install-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sudo sh ./install.sh
# On Mac OS, skip installing pytorch with CUDA because CUDA is not supported
if [[ $OSTYPE != 'darwin'* ]]; then
# Manually install pytorch with `--no-cache-dir` to avoid pip getting killed: https://stackoverflow.com/a/54329850
pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu117 --no-cache-dir
pip install torch==2.0.1+cu117 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu117 --no-cache-dir
fi
# Install all pinned dependencies
pip install -r requirements.txt
Expand Down

0 comments on commit b40ac4e

Please sign in to comment.