From f7dd63008ee195c471042a32251ec0e3bc91571e Mon Sep 17 00:00:00 2001 From: Issy Long Date: Tue, 28 Feb 2023 12:52:21 +0000 Subject: [PATCH] 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. --- .github/workflows/rubocop-filepaths.yml | 29 ------------------------- .github/workflows/tests.yml | 13 +++++++++++ 2 files changed, 13 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/rubocop-filepaths.yml diff --git a/.github/workflows/rubocop-filepaths.yml b/.github/workflows/rubocop-filepaths.yml deleted file mode 100644 index 0783f2fcda..0000000000 --- a/.github/workflows/rubocop-filepaths.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5aa53cfe54..b8501d2ac4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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