Add model/dataset cache to GH actions (#26) #58
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: checks | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '*' | |
permissions: | |
actions: write | |
jobs: | |
checks: | |
name: checks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: cache models and datasets | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/huggingface | |
key: ${{ runner.os }}-huggingface-cache-v1 # increment this key to invalidate the cache when new models/datasets are added | |
- name: dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -e . | |
- name: black | |
run: black --check . | |
- name: isort | |
run: isort --profile black --check . | |
- name: pytest | |
run: pytest |