From 7b782e053075b76b0ce37421ac73443f3cc253dd Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Thu, 9 Mar 2023 13:22:39 +0100 Subject: [PATCH] ci: update & defaults (#121) --- .github/actions/cache/action.yml | 11 +++++------ .github/actions/pkg-install/action.yml | 4 ++-- .github/workflows/check-docs.yml | 9 +++++---- .github/workflows/check-package.yml | 2 +- .github/workflows/deploy-docs.yml | 14 ++++---------- 5 files changed, 17 insertions(+), 23 deletions(-) diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index f0e50067..d13f12e3 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -23,8 +23,7 @@ runs: steps: - name: install assitant's deps - run: | - pip install fire requests packaging + run: pip install fire requests packaging shell: bash - name: Set min. dependencies @@ -34,16 +33,16 @@ runs: - name: Determine caches id: cache_dirs - run: | - echo "pip_dir=$(pip cache dir)" >> $GITHUB_OUTPUT + run: echo "pip_dir=$(pip cache dir)" >> $GITHUB_OUTPUT shell: bash - name: Cache 💽 pip uses: actions/cache@v3 with: path: ${{ steps.cache_dirs.outputs.pip_dir }} - key: ${{ runner.os }}-py${{ inputs.python-version }}-pip-${{ inputs.offset }}-${{ hashFiles('requirements.txt') }} - restore-keys: ${{ runner.os }}-py${{ inputs.python-version }}-pip-${{ inputs.offset }}- + key: py${{ inputs.python-version }}-pip-${{ inputs.offset }}-${{ hashFiles('requirements.txt') }} + restore-keys: py${{ inputs.python-version }}-pip-${{ inputs.offset }}- + enableCrossOsArchive: true - name: Cache 💽 conda uses: actions/cache@v3 diff --git a/.github/actions/pkg-install/action.yml b/.github/actions/pkg-install/action.yml index 6ba497c9..782b66ba 100644 --- a/.github/actions/pkg-install/action.yml +++ b/.github/actions/pkg-install/action.yml @@ -10,9 +10,9 @@ inputs: description: 'Import name to test with after installation' required: true pip-flags: - description: additional pil install flags + description: additional pip install flags required: false - default: "" + default: "-f https://download.pytorch.org/whl/cpu/torch_stable.html" runs: using: "composite" diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml index d45bbdac..c1f8af3f 100644 --- a/.github/workflows/check-docs.yml +++ b/.github/workflows/check-docs.yml @@ -36,6 +36,9 @@ defaults: run: shell: bash +env: + TORCH_URL: "https://download.pytorch.org/whl/torch_stable.html" + jobs: docs-test: @@ -54,8 +57,7 @@ jobs: - name: Install dependencies run: | - pip install -e . -U -r ${{ inputs.requirements-file }} \ - -f https://download.pytorch.org/whl/cpu/torch_stable.html + pip install -e . -U -r ${{ inputs.requirements-file }} -f ${TORCH_URL} pip --version pip list shell: bash @@ -88,8 +90,7 @@ jobs: - name: Install dependencies run: | - pip install -e . -U -r ${{ inputs.requirements-file }} \ - -f https://download.pytorch.org/whl/torch_stable.html + pip install -e . -U -r ${{ inputs.requirements-file }} -f ${TORCH_URL} sudo apt-get update --fix-missing sudo apt-get install -y texlive-latex-extra dvipng texlive-pictures python --version diff --git a/.github/workflows/check-package.yml b/.github/workflows/check-package.yml index 27890548..8262a0e7 100644 --- a/.github/workflows/check-package.yml +++ b/.github/workflows/check-package.yml @@ -19,7 +19,7 @@ on: description: 'Additional pip install flags' required: false type: string - default: "" + default: "-f https://download.pytorch.org/whl/cpu/torch_stable.html" build-matrix: description: 'what building configs in json format' required: false diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 931f395c..e5ab0fd9 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -22,7 +22,7 @@ jobs: - name: Set up Python 🐍 uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.8 # Note: This uses an internal pip API and may not always work # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow @@ -38,21 +38,15 @@ jobs: pip install -e . -U -q -r requirements/docs.txt \ -f https://download.pytorch.org/whl/cpu/torch_stable.html # install Texlive, see https://linuxconfig.org/how-to-install-latex-on-ubuntu-20-04-focal-fossa-linux - sudo apt-get update + sudo apt-get update --fix-missing sudo apt-get install -y texlive-latex-extra dvipng texlive-pictures pip --version pip list shell: bash - - name: Print 🖨️ dependencies - uses: ./.github/actions/pip-list - - name: Make Documentation - run: | - cd docs - make clean - # First run the same pipeline as Read-The-Docs - make html --jobs 2 + working-directory: ./docs + run: make html --jobs 2 - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@v4.4.1