Skip to content

Commit

Permalink
Merge pull request #16390 from Bo98/style-cache
Browse files Browse the repository at this point in the history
workflows/tests: add style caching
  • Loading branch information
Bo98 authored Dec 23, 2023
2 parents afe453d + cee50fc commit 6a92925
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ concurrency:

jobs:
syntax:
if: github.repository == 'Homebrew/brew'
if: github.repository_owner == 'Homebrew'
runs-on: ubuntu-22.04
steps:
- name: Set up Homebrew
Expand All @@ -47,6 +47,13 @@ jobs:
- name: Install shellcheck and shfmt
run: brew install shellcheck shfmt

- name: Cache style cache
uses: actions/cache@v3
with:
path: ~/.cache/Homebrew/style
key: syntax-style-cache-${{ github.sha }}
restore-keys: syntax-style-cache-

- run: brew style

- run: brew typecheck
Expand All @@ -67,7 +74,7 @@ jobs:
tap-syntax:
name: tap syntax
needs: syntax
if: startsWith(github.repository, 'Homebrew/')
if: github.repository_owner == 'Homebrew'
runs-on: ubuntu-22.04
steps:
- name: Set up Homebrew
Expand All @@ -88,6 +95,13 @@ jobs:
- name: Install Bundler RubyGems
run: brew install-bundler-gems --groups=style

- name: Cache style cache
uses: actions/cache@v3
with:
path: ~/.cache/Homebrew/style
key: tap-syntax-style-cache-${{ github.sha }}
restore-keys: tap-syntax-style-cache-

- name: Run brew style on homebrew-core
run: brew style homebrew/core

Expand Down Expand Up @@ -127,7 +141,7 @@ jobs:
formula-audit:
name: formula audit
needs: syntax
if: startsWith(github.repository, 'Homebrew/')
if: github.repository_owner == 'Homebrew'
runs-on: ubuntu-22.04
steps:
- name: Set up Homebrew
Expand All @@ -150,7 +164,7 @@ jobs:
cask-audit:
name: cask audit
needs: syntax
if: startsWith(github.repository, 'Homebrew/')
if: github.repository_owner == 'Homebrew'
runs-on: macos-13
steps:
- name: Set up Homebrew
Expand Down Expand Up @@ -383,7 +397,7 @@ jobs:
test-default-formula:
name: ${{ matrix.name }}
needs: syntax
if: startsWith(github.repository, 'Homebrew/')
if: github.repository_owner == 'Homebrew'
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
Expand Down

0 comments on commit 6a92925

Please sign in to comment.