Skip to content

Commit

Permalink
feat(ci): cache poetry in CI (#14485)
Browse files Browse the repository at this point in the history
  • Loading branch information
SauravMaheshkar authored Jul 12, 2024
1 parent e153a1e commit 2f547d6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ jobs:
python-version: ["3.9"]
steps:
- uses: actions/checkout@v3
- name: Install Poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
cache: "poetry"
cache-dependency-path: "**/poetry.lock"
- name: Install deps
shell: bash
run: poetry install
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
- name: Install Poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
cache: "poetry"
cache-dependency-path: "**/poetry.lock"
- name: Install pre-commit
shell: bash
run: poetry run pip install pre-commit
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Install Poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
cache: "poetry"
cache-dependency-path: "**/poetry.lock"
- name: Install deps
shell: bash
run: pip install -e .
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish_sub_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
cache: "poetry"
cache-dependency-path: "**/poetry.lock"
- name: Get changed pyproject files
id: changed-files
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ jobs:
fetch-depth: 0
- name: update rustc
run: rustup update stable
- name: Install Poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
cache: "poetry"
cache-dependency-path: "**/poetry.lock"
- uses: pantsbuild/actions/init-pants@v5-scie-pants
with:
# v0 makes it easy to bust the cache if needed
Expand Down

0 comments on commit 2f547d6

Please sign in to comment.