From 744d30159c6c8f54450aa02e58a6cc5c34536baa Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Tue, 15 Mar 2022 11:58:55 +0800 Subject: [PATCH] Cache pip packages in GitHub actions. --- .../workflows/run-librispeech-2022-03-12.yml | 39 +++++++------------ requirements-ci.txt | 23 +++++++++++ 2 files changed, 38 insertions(+), 24 deletions(-) create mode 100644 requirements-ci.txt diff --git a/.github/workflows/run-librispeech-2022-03-12.yml b/.github/workflows/run-librispeech-2022-03-12.yml index 74052312e..0e4d6130c 100644 --- a/.github/workflows/run-librispeech-2022-03-12.yml +++ b/.github/workflows/run-librispeech-2022-03-12.yml @@ -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: | diff --git a/requirements-ci.txt b/requirements-ci.txt new file mode 100644 index 000000000..5443eb931 --- /dev/null +++ b/requirements-ci.txt @@ -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