Skip to content

Commit 7faec46

Browse files
committed
improve ci
1 parent 69040b7 commit 7faec46

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.github/workflows/tests.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
fail-fast: false
2424
matrix:
25-
python-version:
25+
python:
2626
- "3.9"
2727
- "3.10"
2828
- "3.11"
@@ -34,6 +34,10 @@ jobs:
3434

3535
runs-on: ${{ matrix.os }}
3636

37+
concurrency:
38+
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python }}
39+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
40+
3741
env:
3842
HF_TOKEN: ${{ secrets.HF_TOKEN }}
3943
OS_NAME: ${{ matrix.os }}
@@ -45,7 +49,7 @@ jobs:
4549
- name: Set up Python
4650
uses: actions/setup-python@v5
4751
with:
48-
python-version: ${{ matrix.python-version }}
52+
python-version: ${{ matrix.python }}
4953
cache: "pip"
5054
cache-dependency-path: "setup.py"
5155

@@ -54,6 +58,12 @@ jobs:
5458
python -m pip install --upgrade pip
5559
python -m pip install ".[torch,dev]"
5660
61+
- name: Cache files
62+
uses: actions/cache@v4
63+
with:
64+
path: ${{ runner.temp }}/huggingface
65+
key: huggingface-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('tests/version.txt') }}
66+
5767
- name: Check quality
5868
run: |
5969
make style && make quality
@@ -64,4 +74,5 @@ jobs:
6474
6575
- name: Test with pytest
6676
run: |
77+
export HF_HOME=${{ runner.temp }}/huggingface
6778
make test

tests/check_license.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
def main():
23-
path_list = []
23+
path_list: list[Path] = []
2424
for check_dir in sys.argv[1:]:
2525
path_list.extend(Path(check_dir).glob("**/*.py"))
2626

tests/version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.9.3.100

0 commit comments

Comments
 (0)