Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI

on:
workflow_call:
pull_request:
# merge queue is required so all commits on target branches trigger this workflow
# despite lack of the push event trigger here
Expand Down Expand Up @@ -46,9 +47,6 @@ jobs:
lint-workflows:
name: Lint workflows
runs-on: ubuntu-latest
permissions:
actions: read # only required in private repos
security-events: write # allow writing security events
Comment thread
bluwy marked this conversation as resolved.
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down Expand Up @@ -99,7 +97,7 @@ jobs:

- name: Upload coverage
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
if: matrix.node_version == 24
if: matrix.node_version == 24 && github.event_name != 'workflow_call'
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,16 @@ jobs:
with:
version: pnpm version-packages

publish:
name: Publish
ci:
if: needs.version.outputs.hasChangesets == 'false'
needs: version
permissions:
contents: read
uses: ./.github/workflows/ci.yml

publish:
name: Publish
needs: ci
Comment on lines +46 to +55

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we set up like this instead? https://stackoverflow.com/a/64733705

Otherwise ci.yml is going to be executed twice from a push event, and possibly cancel because of the concurrency setup.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we set up like this instead? https://stackoverflow.com/a/64733705

I'm not sure if this would work because we rely on merge_group now and they kinda fire before stuff lands on main. But either way, decoupling it like this would be a little bit implicit (or at least not as discoverable) - which would hurt DX a little bit because the changeset workflow would always be "delayed".

Otherwise ci.yml is going to be executed twice from a push event, and possibly cancel because of the concurrency setup.

Good point about concurrency - I don't quite know how that would work in this special mode. This needs testing.

I'm fine with the CI workflow executing more than once in those scenarios though because it would only happen pre-publish (but not pre-version)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll have to figure out the concurrency issue. I also think this will trigger often than not though because we execute when there's no changesets, not only before publish.

If we can get both sorted out I'm ok with doing this.

runs-on: ubuntu-latest
environment: npm
timeout-minutes: 20
Expand Down