Cache pip packages in GitHub actions.

This commit is contained in:
Fangjun Kuang 2022-03-15 11:58:55 +08:00
parent d0d806560f
commit 744d30159c
2 changed files with 38 additions and 24 deletions

View File

@ -22,19 +22,17 @@ on:
branches:
- master
pull_request:
types: [labeled]
branches:
- master
jobs:
run_librispeech_2022_03_12:
if: github.event.label.name == 'ready' || github.event_name == 'push'
# if: github.event.label.name == 'ready' || github.event_name == 'push'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04]
python-version: [3.7, 3.8, 3.9]
torch: ["1.10.0"]
torchaudio: ["0.10.0"]
k2-version: ["1.9.dev20211101"]
fail-fast: false
@ -43,30 +41,23 @@ jobs:
with:
fetch-depth: 0
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip pytest
# numpy 1.20.x does not support python 3.6
pip install numpy==1.19
pip install torch==${{ matrix.torch }}+cpu torchaudio==${{ matrix.torchaudio }}+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
pip install k2==${{ matrix.k2-version }}+cpu.torch${{ matrix.torch }} -f https://k2-fsa.org/nightly/
python3 -m pip install git+https://github.com/lhotse-speech/lhotse
python3 -m pip install kaldifeat
# We are in ./icefall and there is a file: requirements.txt in it
pip install -r requirements.txt
- name: Install graphviz
shell: bash
run: |
python3 -m pip install -qq graphviz
sudo apt-get -qq install graphviz
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: '**/requirements-ci.txt'
- name: Install Python dependencies
run: |
pip install -r ./requirements-ci.txt
- name: Download pre-trained model
shell: bash
run: |

23
requirements-ci.txt Normal file
View File

@ -0,0 +1,23 @@
# dependencies for GitHub actions
#
# See https://github.com/actions/setup-python#caching-packages-dependencies
# numpy 1.20.x does not support python 3.6
numpy==1.19
pytest==7.1.0
graphviz==0.19.1
-f https://download.pytorch.org/whl/cpu/torch_stable.html
torch==1.10.0+cpu
torchaudio==0.10.0+cpu
-f https://k2-fsa.org/nightly/
k2==1.9.dev20211101+cpu.torch1.10.0
lhotse==0.12.0
kaldifeat==1.12
kaldilm==1.11
kaldialign==0.2
sentencepiece==0.1.96
tensorboard==2.8.0
typeguard==2.13.3