-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to not install the project #18
Conversation
action.yml
Outdated
shell: bash | ||
|
||
- name: Install project with --extras=${{ inputs.extras }} --with=${{ inputs.groups }} | ||
if: inputs.extras != '' || inputs.groups != '' | ||
# (Empty extras or groups lists are fine.) | ||
run: poetry install --no-interaction --extras="${{ inputs.extras }}" --with="${{ inputs.groups }}" | ||
run: poetry install --no-interaction --extras="${{ inputs.extras }}" --with="${{ inputs.groups }}" ${{ inputs.install-project == 'true' && '' || '--no-root' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No wait, ''
is falsey so this won't work nyargh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does GHA not have a ternary syntax :((
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh bugger, I just trusted you here! https://github.com/orgs/community/discussions/26738 has some context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GHA would probably say "if it's complicated, write it in javascript" tbh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you want {{ inputs.install-project == 'true' && '--no-root' || '' }}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err != 'true'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. It'd be good to test it on a Synapse PR if you could before merging, e.g. by changing it to use setup-python-poetry@erikj/install_project
, but I won't block you on doing so.
action.yml
Outdated
- name: Install project (no extras or groups) | ||
if: inputs.extras == '' && inputs.groups == '' | ||
run: poetry install --no-interaction | ||
run: poetry install --no-interaction ${{ inputs.install-project == 'true' && '' || '--no-root' }} | ||
shell: bash | ||
|
||
- name: Install project with --extras=${{ inputs.extras }} --with=${{ inputs.groups }} | ||
if: inputs.extras != '' || inputs.groups != '' | ||
# (Empty extras or groups lists are fine.) | ||
run: poetry install --no-interaction --extras="${{ inputs.extras }}" --with="${{ inputs.groups }}" | ||
run: poetry install --no-interaction --extras="${{ inputs.extras }}" --with="${{ inputs.groups }}" ${{ inputs.install-project == 'true' && '' || '--no-root' }} | ||
shell: bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was a bit confused by why we have these two steps here. I think it's because I couldn't find a cleaner way to only add --extras
if inputs.extras
was specified: I don't think there's a ternary syntax or helper function?
matrix-org/synapse#15338 seems to now do the right thing, which tests this |
Thanks, I can see that the pydantic job succeeds (so compiled the Rust, ergo installed the project) and that the sampleconfig job failed because it couldn't import Synapse with the new option set. LGTM |
Fixes #15