Skip to content

Commit

Permalink
workflows/tests: add style caching
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed Dec 23, 2023
1 parent 2cbe388 commit cee50fc
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 cee50fc

Please sign in to comment.