Skip to content
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

Improve ci.yml and add dependabot.yml #2767

Merged
merged 1 commit into from
Mar 19, 2024
Merged

Conversation

sobolevn
Copy link
Contributor

@sobolevn sobolevn commented Mar 19, 2024

Here's the full list of changes:

  • workflow_dispatch: allows you to manually run actions from the admin panel: https://github.com/gleam-lang/gleam/actions/workflows/ci.yaml It is really useful sometimes, in other cases it just does nothing
  • permissions: sets stricter security rules for this workflow. It should not be able to do anything. Upload / download of artifacts will continue to work: Add details on authentication / permissions used during upload actions/upload-artifact#197 permissions: can be set on individual jobs as well, if needed later
  • concurrency: cancels previous jobs, when new commits are pushed to the CI. It helps to save extra resources and not to continue meaningless work
  • I've changed workflow.os to runner.os, because the first is not really about the runner os, it is just the label we use
  • node-version: is updated, because 16 is reaching its EOL, see https://nodejs.org/en/about/previous-releases 18 is still good 👍
  • I've also updated several actions' versions. No other changes here should be required
  • I've also added dependabot.yml which is a nice tool to update deps, embeded into GitHub itself. It should not be very noisy and can help doing what I'm doing now :)

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Great! Thank you! I've left 1 question

contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Copy link
Member

Choose a reason for hiding this comment

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

Is the head_ref the commit sha? If so, won't this be different every time? I'd have thought that maybe the PR number would be what we want

Copy link
Contributor Author

@sobolevn sobolevn Mar 19, 2024

Choose a reason for hiding this comment

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

No:

The head_ref or source branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target.

https://docs.github.com/en/actions/learn-github-actions/variables

This is a copy/paste from https://github.com/python/cpython/blob/408e127159e54d87bb3464fd8bd60219dc527fac/.github/workflows/build.yml#L28-L30

Copy link
Member

Choose a reason for hiding this comment

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

Oh fab!!

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Thank again!!

@lpil lpil merged commit 1c109da into gleam-lang:main Mar 19, 2024
11 checks passed
@lpil
Copy link
Member

lpil commented Mar 19, 2024

@sobolevn I've started getting lots of annoying notifications like this. Is there a way to disable these? Thank you

image

@sobolevn
Copy link
Contributor Author

Hm, this is interesting. Looks like you use "Rebase and merge" strategy, which I don't use.
And since there are multiple commits at the same time to main, they cancel each other and this notification shows up.

Give me a moment please, I will search what the options are.
Revert this part always is an option.

@sobolevn
Copy link
Contributor Author

I found this: https://stackoverflow.com/a/75403978/4842742

Should we try it? Or should I revert the concurrency change?

@lpil
Copy link
Member

lpil commented Mar 19, 2024

I think it may have been as I merged several PRs in quick succession. Maybe we can keep the config for a little while and see how often this happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants