Skip to content

Commit

Permalink
Improve speed of actions (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdvllrs authored Apr 5, 2024
1 parent 8704f33 commit 8fd053d
Show file tree
Hide file tree
Showing 6 changed files with 277 additions and 226 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/docs-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,26 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.11.4'
- name: Load cached Poetry install
uses: actions/cache@v3
id: cached-poetry
with:
path: ~/.local
key: poetry-0
- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --with docs
poetry run python -m pip install --upgrade pip
poetry run pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
poetry install --with test,dev,docs --without torch
poetry run pip install torch --index-url https://download.pytorch.org/whl/cpu
poetry run pip install lightning
- run: poetry run python ./docs/make.py ${{ github.event.release.tag_name }}
- uses: actions/upload-pages-artifact@v3
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,26 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.11.4'
- name: Load cached Poetry install
uses: actions/cache@v3
id: cached-poetry
with:
path: ~/.local
key: poetry-0
- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --with docs
poetry run python -m pip install --upgrade pip
poetry run pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
poetry install --with test,dev,docs --without torch
poetry run pip install torch --index-url https://download.pytorch.org/whl/cpu
poetry run pip install lightning
- run: poetry run python ./docs/make.py
- uses: actions/upload-pages-artifact@v3
Expand Down
29 changes: 23 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,35 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: "3.11.4"
- name: Load cached Poetry install
uses: actions/cache@v3
id: cached-poetry
with:
path: ~/.local
key: poetry-0
- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --with test --with dev
poetry run pip install --upgrade pip
poetry install --with test,dev,docs --without torch
poetry run pip install torch --index-url https://download.pytorch.org/whl/cpu
poetry run pip install lightning
- name: Ruff checks
uses: chartboost/ruff-action@v1
with:
args: "format --check"
- name: Ruff Formatting
run: poetry run ruff format --check
- name: Ruff Linter
run: poetry run ruff check
- name: Analysing the code with mypy
run: |
poetry run mypy --install-types --non-interactive .
Expand Down
Loading

0 comments on commit 8fd053d

Please sign in to comment.