Skip to content

Commit

Permalink
Cache pip packages in GitHub actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Mar 15, 2022
1 parent d0d8065 commit 744d301
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 21 deletions.
33 changes: 12 additions & 21 deletions .github/workflows/run-librispeech-2022-03-12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -43,29 +41,22 @@ jobs:
with:
fetch-depth: 0

- name: Install graphviz
shell: bash
run: |
sudo apt-get -qq install graphviz
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: '**/requirements-ci.txt'

- 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
pip install -r ./requirements-ci.txt
- name: Install graphviz
shell: bash
run: |
python3 -m pip install -qq graphviz
sudo apt-get -qq install graphviz
- name: Download pre-trained model
shell: bash
Expand Down
23 changes: 23 additions & 0 deletions requirements-ci.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 744d301

Please sign in to comment.