Merge pull request #8766 from issyl0/brew-typecheck-ci
dev-cmd/typecheck: Group all automatic updates code into one \`--ci\` switch
This commit is contained in:
commit
5dbf31522f
@ -1,8 +1,8 @@
|
|||||||
name: Update Tapioca definitions
|
name: Update Sorbet-related files
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- .github/workflows/tapioca.yml
|
- .github/workflows/sorbet.yml
|
||||||
branches-ignore:
|
branches-ignore:
|
||||||
- master
|
- master
|
||||||
schedule:
|
schedule:
|
||||||
@ -26,7 +26,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git fetch origin
|
git fetch origin
|
||||||
|
|
||||||
BRANCH="tapioca-update"
|
BRANCH="sorbet-files-update"
|
||||||
echo "::set-output name=branch::${BRANCH}"
|
echo "::set-output name=branch::${BRANCH}"
|
||||||
|
|
||||||
if git ls-remote --exit-code --heads origin "$BRANCH"; then
|
if git ls-remote --exit-code --heads origin "$BRANCH"; then
|
||||||
@ -37,9 +37,9 @@ jobs:
|
|||||||
BRANCH_EXISTS="1"
|
BRANCH_EXISTS="1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if brew typecheck --prune-files-list --update-definitions --fail-if-not-changed; then
|
if brew typecheck --update --fail-if-not-changed; then
|
||||||
git add "$GITHUB_WORKSPACE/Library/Homebrew/sorbet"
|
git add "$GITHUB_WORKSPACE/Library/Homebrew/sorbet"
|
||||||
git commit -m "sorbet: update RBI files using Tapioca." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/tapioca.yml)."
|
git commit -m "sorbet: Update RBI files and prune files.yaml." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml)."
|
||||||
echo "::set-output name=committed::true"
|
echo "::set-output name=committed::true"
|
||||||
if [ -n "$BRANCH_EXISTS" ]; then
|
if [ -n "$BRANCH_EXISTS" ]; then
|
||||||
echo "::set-output name=pull_request::true"
|
echo "::set-output name=pull_request::true"
|
||||||
@ -16,10 +16,8 @@ module Homebrew
|
|||||||
EOS
|
EOS
|
||||||
switch "-q", "--quiet",
|
switch "-q", "--quiet",
|
||||||
description: "Silence all non-critical errors."
|
description: "Silence all non-critical errors."
|
||||||
switch "--update-definitions",
|
switch "--update",
|
||||||
description: "Update Tapioca gem definitions of recently bumped gems"
|
description: "Update RBI files and prune #{SORBET_FILES_YAML}"
|
||||||
switch "--prune-files-list",
|
|
||||||
description: "Remove deleted filepaths from #{SORBET_FILES_YAML}"
|
|
||||||
switch "--fail-if-not-changed",
|
switch "--fail-if-not-changed",
|
||||||
description: "Return a failing status code if all gems are up to date " \
|
description: "Return a failing status code if all gems are up to date " \
|
||||||
"and gem definitions do not need a tapioca update"
|
"and gem definitions do not need a tapioca update"
|
||||||
@ -41,7 +39,8 @@ module Homebrew
|
|||||||
Homebrew.install_bundler_gems!
|
Homebrew.install_bundler_gems!
|
||||||
|
|
||||||
HOMEBREW_LIBRARY_PATH.cd do
|
HOMEBREW_LIBRARY_PATH.cd do
|
||||||
if args.prune_files_list?
|
if args.update?
|
||||||
|
ohai "Checking for deleted filenames in #{SORBET_FILES_YAML}..."
|
||||||
lines_to_keep = []
|
lines_to_keep = []
|
||||||
sorbet_keywords = ["true:", "false:", "strict:", "strong:"]
|
sorbet_keywords = ["true:", "false:", "strict:", "strong:"]
|
||||||
|
|
||||||
@ -52,12 +51,11 @@ module Homebrew
|
|||||||
filepath = line.split(" ").last
|
filepath = line.split(" ").last
|
||||||
lines_to_keep << line if File.exist?(filepath)
|
lines_to_keep << line if File.exist?(filepath)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
File.write(SORBET_FILES_YAML, "#{lines_to_keep.join("\n")}\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
File.write(SORBET_FILES_YAML, "#{lines_to_keep.join("\n")}\n")
|
ohai "Updating Tapioca RBI files..."
|
||||||
end
|
|
||||||
|
|
||||||
if args.update_definitions?
|
|
||||||
system "bundle", "exec", "tapioca", "sync"
|
system "bundle", "exec", "tapioca", "sync"
|
||||||
system "bundle", "exec", "srb", "rbi", "hidden-definitions"
|
system "bundle", "exec", "srb", "rbi", "hidden-definitions"
|
||||||
system "bundle", "exec", "srb", "rbi", "todo"
|
system "bundle", "exec", "srb", "rbi", "todo"
|
||||||
|
|||||||
@ -1244,10 +1244,8 @@ Check for typechecking errors using Sorbet.
|
|||||||
|
|
||||||
* `-q`, `--quiet`:
|
* `-q`, `--quiet`:
|
||||||
Silence all non-critical errors.
|
Silence all non-critical errors.
|
||||||
* `--update-definitions`:
|
* `--update`:
|
||||||
Update Tapioca gem definitions of recently bumped gems
|
Update RBI files and prune sorbet/files.yaml
|
||||||
* `--prune-files-list`:
|
|
||||||
Remove deleted filepaths from sorbet/files.yaml
|
|
||||||
* `--fail-if-not-changed`:
|
* `--fail-if-not-changed`:
|
||||||
Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update
|
Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update
|
||||||
* `--dir`:
|
* `--dir`:
|
||||||
|
|||||||
@ -1718,12 +1718,8 @@ Check for typechecking errors using Sorbet\.
|
|||||||
Silence all non\-critical errors\.
|
Silence all non\-critical errors\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-update\-definitions\fR
|
\fB\-\-update\fR
|
||||||
Update Tapioca gem definitions of recently bumped gems
|
Update RBI files and prune sorbet/files\.yaml
|
||||||
.
|
|
||||||
.TP
|
|
||||||
\fB\-\-prune\-files\-list\fR
|
|
||||||
Remove deleted filepaths from sorbet/files\.yaml
|
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-fail\-if\-not\-changed\fR
|
\fB\-\-fail\-if\-not\-changed\fR
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user