Commit Graph

84 Commits

Author SHA1 Message Date
Mohammed Keyvanzadeh
859e6aa100
[github] GitHub Actions workflows changes (#65856)
- Remove usages of the non-existent `ignore-forks` field, conditions in
jobs already exist to prevent the jobs from running in forks.
- Don't use variables in the `printf` format string. Use `printf
"..%s.." "$foo"`. ([SC2059](https://www.shellcheck.net/wiki/SC2059))
- Double quote variable expansion to prevent globbing and word
splitting. ([SC2086](https://www.shellcheck.net/wiki/SC2086))
- Prefer `[ p ] || [ q ]` as `[ p -o q ]` is not well defined.
([SC2166](https://www.shellcheck.net/wiki/SC2166))
- Consider `{ cmd1; cmd2; } >> file` instead of individual redirects.
([SC2129](https://www.shellcheck.net/wiki/SC2129))
- Use `$(...)` notation instead of legacy notation `...`.
([SC2006](https://www.shellcheck.net/wiki/SC2006))
- Use `./*glob*` or `-- *glob*` so names with dashes won't become
options. ([SC2035](https://www.shellcheck.net/wiki/SC2035))
- Refactor JavaScript code in certain workflows.
- Change workflow variable substitution style of some workflows to be
consistent with others.
2023-09-13 01:51:47 +03:30
Tom Stellard
64751ea2c5
github-automation: Use a single comment for team mentions on pull requests (#66037)
This will reduce the number of notifications created when a pull request
label is added. Each team will only get a notification when their team's
label is added and not when other teams' labels are added.
2023-09-12 13:21:29 -07:00
Marc Auberer
6d2aaa5fdb
[GitHub] use checkout action v4 (#65819)
Upgrade checkout action to v4 to make use of node20.
Node 16, which v3 is using, reaches end of life on 2023-09-11.
2023-09-12 12:08:56 +02:00
Tom Stellard
91fdb20915 workflows: Split new-prs into two workflows
We cannot use the default github token for labeling PRs, because this
will not trigger the PR Subscriber job.  However, we weren't allowed to
use a different token via a secret, because secrets aren't allowed
in PR workflows.

The solution is to create two workflows, the first accepts the
pull_request_taget event extracts the PR number and then starts
the second workflow which adds the labels to the PRs.

This separation ensures that nothing malicious in the first workflow is
able to access the secret we use in the second workflow.
2023-09-08 22:09:33 -07:00
Tom Stellard
1ed710836a workflows: Reconfigure pr-subscriber action so that it can access secrets
Secrets are not available for workflows triggered by PRs, so we need
to split the pr-subscriber action into two separate actions.  The
first will listen for new labels on PRs and the second will add
a comment with the team mention.

See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
2023-09-08 11:55:59 -07:00
Tom Stellard
ea98e1c537 workflows/pr-subscriber: Limit action to llvm/llvm-project repo 2023-09-08 10:41:06 -07:00
Tom Stellard
e7fa52adcf workflows: Fix typo in pr-subscriber 2023-09-08 10:00:21 -07:00
Tom Stellard
5f16a3a489
workflows: Add a simple pull request subscription workflow (#64913)
This new workflow will make it possible for people to subscribe to pull
requests based on the labels that are added. Labels will be added
automatically to the pull requests based on the modified files and each
label will be associated with a GitHub team that will be notified when
the label is added.

See
https://discourse.llvm.org/t/changes-to-pull-request-subscription-system/73296
2023-09-08 09:40:37 -07:00
Tobias Hieta
d55ac38ace
Add GitHub workflow for check Python file formatting (#65482)
Using darker which is doing black on diffs, similar to git-clang-format.
2023-09-08 18:22:20 +02:00
cor3ntin
c144086997
[Github] Workaround a GH action bug causing manually added labels to be removed (#65395)
Fixes https://github.com/llvm/llvm-project/issues/65345
2023-09-05 20:46:41 +02:00
Corentin Jabot
a58c59e679 Revert "Update new-prs.yml"
This was meant to be a test in my personal fork...

This reverts commit ee53efde38.
2023-09-05 19:30:11 +02:00
cor3ntin
ee53efde38
Update new-prs.yml 2023-09-05 19:05:46 +02:00
cor3ntin
d17e6cc9e7
[Github] Add labels on pull requests based on paths. (#65308)
Using https://github.com/actions/labeler, this add a workflow to
automatically label PRs, in hope to reduce the work needed to triage new
PRs.

"new-prs-labeler.yml" has been seeded taking inspiration from the
CODEOWNERS file when there was an existing corresponding label on the
issue tracker.
2023-09-05 15:26:48 +02:00
Corentin Jabot
836f2470fb [Github] Move the issue labeler data out of workflows
To avoid it being considered a workflow script.
2023-09-05 15:10:42 +02:00
cor3ntin
3301edf45d
[Github] Improve automatic new issue labelling (#65309)
This patch:
* Replaces `andymckay/labeler` which does not appear to be maintained by
github official solution
* Removes the closed issue workflow which was disabled a few years ago
and never fixed.
* Adds a few rules to add label based on PR title, hopefully that can
make triaging simpler. If that turns out to be useful, we can consider
adding more rules for backends, etc. We could technically also pattern
match the body of the issue but I'm concerned about trying to be _too_
clever.

The new system is only triggered on PR open so manual labels should not
be removed.
2023-09-05 14:53:56 +02:00
Aiden Grossman
3e67d7b682
[Github] Disable repo lockdown (#65161)
Now that PRs are supposed to be open, the repo lockdown needs to be
disabled so people can actually open them up on all parts of the
repository.
2023-09-01 12:09:51 -07:00
Tobias Hieta
1148cfac51
[workflow] Allow creation of PRs in the docs subdir 2023-09-01 12:32:07 +02:00
Louis Dionne
c7663853fa Disable the repo-lockdown script in a narrow way to allow testing CI
This is necessary to allow testing pre-commit CI from GH PRs before
the repo-lockdown script is removed entirely.
2023-08-29 14:06:23 -04:00
Tom Stellard
99fb0af80d
workflows: Fix libclang-abi test after update to use download-artifac… (#64877)
workflows: Fix libclang-abi test after update to use download-artifact v3
2023-08-28 09:38:27 -07:00
Tom Stellard
102970091e workflows: Disable repo-lockdown for llvm/utils/git
Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D158569
2023-08-23 07:51:29 -07:00
Tobias Hieta
28226e5a1b
[Workflow] Run the repository sync script from GH.
Also various fixes to the script to work correctly
in GH actions.

Differential Revision: https://reviews.llvm.org/D156873
2023-08-10 09:01:18 +02:00
MyDeveloperDay
8b003c6201
Workflows: Allow pull request for clang-format changes (#64332)
* Allow pull request for clang-format changes

Remove repo lockdown on clang-format specific directories

* Missing / from unittests
2023-08-02 21:12:52 +01:00
Tom Stellard
ffecb43c48 workflows/release-tasks: Add missing sudo 2023-08-01 15:59:04 -07:00
Tom Stellard
5754f5af3c Workflows: Allow pull requests for .github directory
Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D156595
2023-08-01 13:33:54 -07:00
Chris Bieneman
7b654acc4d [GitHub] Update repo lockdown to exclude lldb
This change enables the LLDB project to begin experimenting with
pull-request workflows to help identify issues was we move toward
adopting pull requests.

Reviewed By: tstellar, JDevlieghere

Differential Revision: https://reviews.llvm.org/D155315
2023-07-14 19:35:15 -05:00
Anton Korobeynikov
06a9975d61 Temporary switch off labeler on closed issues 2023-06-27 11:09:00 -07:00
Tom Stellard
3e984182dc workflows/release-tasks: Upload lit releases to pypi
Reviewed By: thieta, kwk

Differential Revision: https://reviews.llvm.org/D146491
2023-05-31 09:25:19 -07:00
Tobias Hieta
e46aa6d3b6
[NFC][Py Reformat] Reformat version-check.py in .github dir 2023-05-26 08:11:06 +02:00
Tom Stellard
afa607fbac workflows/release-tasks: Remove stray backslash
Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D150018
2023-05-12 23:34:05 -07:00
Tom Stellard
63bd7726d1 workflows/repo-lockdown: Ignore libcxx and related sub-directories
https://discourse.llvm.org/t/opening-up-prs-experimentally-for-a-subset-of-the-llvm-project/70375/11

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D150314
2023-05-12 23:20:24 -07:00
Tom Stellard
74acaf1809 workflows/release-binaries: Install missing dependencies
Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D148772
2023-04-20 08:21:53 -07:00
Tom Stellard
93d6289c98 workflows/release-tasks: Always run apt-get update before installing deps
There is a bug in the package tree of on the default images that
causes some dependencies not to be found.  Running apt-get gets us
the latest package lists rather than relying on the default lists
in the GitHub Runner imgae, which can be up to a week old.

Running apt-get update before intstalling packages is also recommended in
the official github documentation:

https://docs.github.com/en/actions/using-github-hosted-runners/customizing-github-hosted-runners#installing-software-on-ubuntu-runners

Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D148741
2023-04-20 08:15:50 -07:00
Tom Stellard
cd39791350 workflows/release-binaries: Add missing output variable
Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D148734
2023-04-19 12:59:00 -07:00
Jack Grigg
5b8156bf62 github: Add manual workflow to build and upload release binaries
Reviewed By: kwk

Differential Revision: https://reviews.llvm.org/D143535
2023-04-17 12:03:56 -07:00
Mohammed Keyvanzadeh
2b88298c2a
[github] update action and use major version
- Update the `actions/download-artifact` action to version 3.
- Use the major version of an action instead of specifying the minor or patch versions.

Differential Revision: https://reviews.llvm.org/D148327
2023-04-15 00:52:44 +03:30
Tom Stellard
64c30dc9a2 workflows/release-tasks: Fix missing suffix on doxygen tarballs
Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D145997
2023-03-27 23:28:18 -07:00
Tom Stellard
c52e947f9c workflows/release-tasks: Upload release notes as an artifact
This make sure the docs are always available and can be manually uploaded
if a later step fails.

Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D145996
2023-03-27 23:17:14 -07:00
Jessica Clarke
2be973e9d8 workflows: Don't try and run llvm-bugs in forks
Most forks won't have an LLVM_BUGS_KEY secret, so Mailgun will error out
with a missing key, and if forks do happen to have such a secret then we
still don't want to be getting emails to LLVM's mailing lists for
downstream forks.

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D146235
2023-03-16 16:47:07 +00:00
Joyce Brum
829b8912cd feat: harden permissions for all github workflows
Signed-off-by: Joyce Brum <joycebrum@google.com>

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D144119
2023-03-03 21:34:27 -08:00
Mohammed Keyvanzadeh
d30b187f7d
[github] update actions and make tweaks
- Update the GitHub workflow actions to their latest versions.
- Use the latest Node.js LTS release.
- Use the latest Ubuntu version for consistency across all workflows.
- The `set-output` command is deprecated and will soon be disabled (https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/) so use the new recommended way.
- Use the `$()` expressions for string interpolation instead of the deprecated backticks in Bash.
- Format the YAML files.

Differential Revision: https://reviews.llvm.org/D143015
2023-02-01 06:23:33 +03:30
Tom Stellard
683b83abaa workflows: Fix libclc tests
libclc requires using cmake files to detect the LLVM installation instead
of llvm-config so we need to update our cmake invocation.

Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D142716
2023-01-27 11:23:20 -08:00
Tom Stellard
9f307a02be workflows: Bump python version on Windows to try to fix lldb failure
Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D142719
2023-01-27 11:06:39 -08:00
Tom Stellard
57b491b5c1 Workflows: Fix version-check.py script for when there is no RC tag yet
Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D142598
2023-01-27 06:58:47 -08:00
Tobias Hieta
24c10abe83
[NFC] Fix exception in version-check.py script 2022-09-15 13:34:29 +02:00
Tom Stellard
99020b3c73 workflows/llvm-project-tests: Workaround an issue with lldb builds on Windows
For some reason cmake started selecting a 32-bit version of python on
Windows instead of the 64-bit version when building windows.  Explicitly
setting the default python to 3.10 fixes this problem.

Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D132280
2022-08-20 00:15:18 -07:00
Tom Stellard
5b108dfc15 workflows/version-check: Fix check for release candidates
Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D131650
2022-08-19 21:51:04 -07:00
Tobias Hieta
46a315a331
[workflow] Run release tasks for me (tru) as well.
Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D131493
2022-08-10 10:02:26 +02:00
Tom Stellard
be3587ae9a workflows: Fix typo from 2d3d0f50ce 2022-08-02 21:20:13 -07:00
Tom Stellard
2d3d0f50ce workflows: Remove symbol versions from libclang.so in the libclang ABI test
Now that the symbol version for libclang.so changes for each release again,
we need to remove the symbol versions from the shared library in order
for the ABI checker to be able to compare with an older version of the
shared library.
2022-08-02 21:15:39 -07:00
Tom Stellard
b9a6629193 workflows: Pass phab token to github-automation.py when creating a pull request
The script needs this in order to automatically assign a reviewer.
2022-07-29 09:59:55 -07:00