ci: Include RuboCop filepaths check in syntax workflow
- The slowest part of the separate workflow was the repo checkout step, so include it in here to avoid the overhead.
This commit is contained in:
parent
267d72a9d0
commit
f7dd63008e
29
.github/workflows/rubocop-filepaths.yml
vendored
29
.github/workflows/rubocop-filepaths.yml
vendored
@ -1,29 +0,0 @@
|
||||
name: RuboCop filepaths
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-22.04
|
||||
if: github.repository == 'Homebrew/brew'
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Check public API docs
|
||||
working-directory: Library/Homebrew
|
||||
run: |
|
||||
public_apis=$(git grep -l "@api public" | wc -l | tr -d ' ')
|
||||
rubocop_docs=$(yq '.Style/Documentation.Include' .rubocop.yml | wc -l | tr -d ' ')
|
||||
|
||||
if [[ public_apis -ne rubocop_docs ]]
|
||||
then
|
||||
echo "All public Homebrew APIs should be included in the Style/Documentation RuboCop."
|
||||
echo "There were ${public_apis} '@api public' lines but ${rubocop_docs} filepaths for the 'Style/Documentation' RuboCop."
|
||||
echo "Add or remove the filepaths from Library/Homebrew/.rubocop.yml as appropriate."
|
||||
exit 1
|
||||
fi
|
||||
13
.github/workflows/tests.yml
vendored
13
.github/workflows/tests.yml
vendored
@ -46,6 +46,19 @@ jobs:
|
||||
|
||||
- run: brew typecheck
|
||||
|
||||
- name: Check RuboCop filepaths
|
||||
working-directory: Library/Homebrew
|
||||
run: |
|
||||
public_apis=$(git grep -l "@api public" | wc -l | tr -d ' ')
|
||||
rubocop_docs=$(yq '.Style/Documentation.Include' .rubocop.yml | wc -l | tr -d ' ')
|
||||
if [[ public_apis -ne rubocop_docs ]]
|
||||
then
|
||||
echo "All public Homebrew APIs should be included in the Style/Documentation RuboCop."
|
||||
echo "There were ${public_apis} '@api public' lines but ${rubocop_docs} filepaths for the 'Style/Documentation' RuboCop."
|
||||
echo "Add or remove the filepaths from Library/Homebrew/.rubocop.yml as appropriate."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tap-syntax:
|
||||
name: tap syntax
|
||||
needs: syntax
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user