Skip to content

Commit

Permalink
workflows: update TestBot actions (#17)
Browse files Browse the repository at this point in the history
* workflows: migrate to restore@v3 and add macOS info to cache

* workflows: update order of cleanup execution and remove bundler install

* workflows: explicitly enable updating test-bot

* workflows: deprecate ::set-output command
  • Loading branch information
sayomaki authored Oct 7, 2023
1 parent d28766b commit f8da24f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-bottles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ jobs:
cd bottles
count=$(ls *.json | wc -l | xargs echo -n)
echo "$count bottles"
echo "::set-output name=count::$count"
echo "count=$count" >> $GITHUB_OUTPUT
failures=$(ls failed/*.json | wc -l | xargs echo -n)
echo "$failures failed bottles"
echo "::set-output name=failures::$failures"
echo "failures=$failures" >> $GITHUB_OUTPUT
- name: Upload failed bottles
if: always() && steps.bottles.outputs.failures > 0
Expand Down
31 changes: 22 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,33 @@ jobs:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
core: true
cask: false
test-bot: true

- run: brew test-bot --only-cleanup-before

- name: Set up RubyGems cache
shell: bash
run: |
cache_key_prefix="${{ runner.os }}"
if [[ "${{ runner.os }}" = macOS ]]
then
macos_full_version="$(sw_vers -productVersion)"
macos_version="${macos_full_version%%.*}"
arch="$(uname -m)"
cache_key_prefix="${macos_version}-${arch}"
fi
echo "cache_key_prefix=${cache_key_prefix}" >> "$GITHUB_ENV"
- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v1
uses: actions/cache/restore@v3
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ runner.os }}-rubygems-

- name: Install Homebrew Bundler RubyGems
if: steps.cache.outputs.cache-hit != 'true'
run: brew install-bundler-gems

- run: brew test-bot --only-cleanup-before
key: ${{ env.cache_key_prefix }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ env.cache_key_prefix }}-rubygems-

- run: brew test-bot --only-setup

Expand Down

0 comments on commit f8da24f

Please sign in to comment.