Skip to content

Commit

Permalink
Install deps and project in one go
Browse files Browse the repository at this point in the history
This works around a change in poetry 1.2; see explanation here:
matrix-org/synapse#12626 (comment)

I had originally made the "install deps" and "install project" steps
separate, to allow us to skip the installing deps bit if there was a
cache hit. Maintaining that approach would now be painful because I'd
need two different `poetry install` invocations: one with extras and one
without. And it only saved us 1 or 2 seconds per run.
  • Loading branch information
David Robertson committed May 4, 2022
1 parent 387b367 commit f67eafb
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,14 @@ runs:
(echo pyproject.toml was updated without running \`poetry lock --no-update\`. && false)
shell: bash

- name: Install base dependencies only
if: steps.poetry-venv-cache.outputs.cache-hit != 'true' && inputs.extras == ''
- name: Install project (no extras)
if: inputs.extras == ''
run: poetry install --no-interaction --no-root
shell: bash

- name: Install poetry with --extras=${{ inputs.extras }}
if: steps.poetry-venv-cache.outputs.cache-hit != 'true' && inputs.extras != ''
run: poetry install --no-interaction --no-root --extras="${{ inputs.extras }}"
shell: bash

# (Not sure if this is needed if there's a cache hit?)
- name: Install project
run: poetry install --no-interaction
- name: Install project with --extras=${{ inputs.extras }}
if: inputs.extras != ''
run: poetry install --no-interaction --extras="${{ inputs.extras }}"
shell: bash

# For debugging---let's just check what we're working with.
Expand Down

0 comments on commit f67eafb

Please sign in to comment.