Skip to content

Commit

Permalink
GitHub Actionsが失敗するのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
nix6839 committed Jun 7, 2024
1 parent a9ee67f commit 5d793a8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 60 deletions.
82 changes: 22 additions & 60 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# ci.yml
#
# Copyright © 2013, Paul Hinze & Contributors
# Copyright © 2023, Umi
#
# This software is released under the BSD 2-Clause "Simplified" License.
# see https://github.com/Homebrew/homebrew-cask/blob/2477328ebd/LICENSE
# see https://github.com/Homebrew/homebrew-cask/blob/2103d0407a/LICENSE

name: CI

Expand All @@ -24,23 +23,6 @@ permissions:
contents: read

jobs:
get-changed-casks:
outputs:
changed-casks: ${{ steps.changed-casks.outputs.all_modified_files }}
runs-on: ubuntu-latest
steps:
- name: Check out Pull Request
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get changed casks
id: changed-casks
uses: tj-actions/changed-files@v44
with:
files: |
Casks/*.rb
generate-matrix:
outputs:
matrix: ${{ steps.generate-matrix.outputs.matrix }}
Expand All @@ -62,14 +44,11 @@ jobs:

- name: Generate CI matrix
id: generate-matrix
run: |
brew ruby -- "$(brew --repository homebrew/cask)/cmd/lib/generate-matrix.rb" "${{ github.event.pull_request.url }}"
run: brew ruby -- "$(brew --repository homebrew/cask)/cmd/lib/generate-matrix.rb" --url="${{ github.event.pull_request.url }}"

test:
name: ${{ matrix.name }}
needs:
- get-changed-casks
- generate-matrix
needs: generate-matrix
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
Expand All @@ -82,7 +61,7 @@ jobs:
with:
core: false
cask: true
test-bot: false
test-bot: true

- name: Enable debug mode
run: |
Expand All @@ -98,14 +77,15 @@ jobs:

- name: Clean up CI machine
run: |
if ! brew list --cask visual-studio &>/dev/null; then
if ! rm -r '/Applications/Visual Studio.app'; then
echo '::warning::Removing Visual Studio is no longer necessary.'
fi
if [ "${{ matrix.runner }}" == 'macos-12' ] && ! brew uninstall --cask julia && ! rm -r /Applications/Julia-*.app; then
echo '::warning::Removing Julia is no longer necessary.'
fi
if ! brew uninstall --cask julia && ! rm -r /Applications/Julia-*.app; then
echo '::warning::Removing Julia is no longer necessary.'
if ! rm /usr/local/share/man/man1/al.1 || \
! sudo rm /etc/paths.d/mono-commands || \
! sudo rm -r /Library/Frameworks/Mono.framework || \
! sudo pkgutil --forget com.xamarin.mono-MDK.pkg; then
echo '::warning::Uninstalling Mono is no longer necessary.'
fi
if ! rm /usr/local/bin/dotnet; then
Expand All @@ -116,6 +96,10 @@ jobs:
echo '::warning::Removing `cocoapods` symlink is no longer necessary.'
fi
if ! rm /usr/local/bin/chromedriver; then
echo '::warning::Removing `chromedriver` symlink is no longer necessary.'
fi
brew unlink python && brew link --overwrite python
if: runner.os == 'macOS'

Expand All @@ -127,25 +111,10 @@ jobs:
key: ${{ matrix.runner }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ matrix.runner }}-rubygems-

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

- name: Run brew readall ${{ matrix.tap }}
id: readall
run: brew readall '${{ matrix.tap }}'
if: >
always() &&
contains(fromJSON('["success", "skipped"]'), steps.gems.outcome) &&
!matrix.skip_readall
- name: Run brew style ${{ matrix.tap }}
run: brew style '${{ matrix.tap }}'
if: >
always() &&
contains(fromJSON('["success", "skipped"]'), steps.readall.outcome) &&
!matrix.cask
- name: Run brew test-bot --only-tap-syntax
id: tap-syntax
run: brew test-bot --tap '${{ matrix.tap }}' --only-tap-syntax
if: always() && !matrix.cask

- name: Run brew fetch --cask ${{ matrix.cask.token }}
id: fetch
Expand All @@ -154,18 +123,17 @@ jobs:
timeout-minutes: 30
if: >
always() &&
contains(fromJSON('["success", "skipped"]'), steps.readall.outcome) &&
contains(fromJSON('["success", "skipped"]'), steps.tap-syntax.outcome) &&
matrix.cask
- name: Run brew audit --cask${{ (matrix.cask && ' ') || ' --tap ' }}${{ matrix.cask.token || matrix.tap }}
id: audit
run: |
brew audit --cask ${{ join(matrix.audit_args, ' ') }}${{ (matrix.cask && ' ') || ' --tap ' }}'${{ matrix.cask.token || matrix.tap }}'
timeout-minutes: 30
if: >-
contains(needs.get-changed-casks.outputs.changed-casks, 'Casks/voicevox.rb') &&
if: >
always() &&
contains(fromJSON('["success", "skipped"]'), steps.readall.outcome) &&
contains(fromJSON('["success", "skipped"]'), steps.tap-syntax.outcome) &&
(!matrix.cask || steps.fetch.outcome == 'success') &&
!matrix.skip_audit
Expand Down Expand Up @@ -252,12 +220,6 @@ jobs:
if: always() && steps.install.outcome == 'success' && !fromJSON(steps.info.outputs.manual_installer)
timeout-minutes: 30

- name: Uninstall formula dependencies
run: |
brew uninstall --formula ${{ join(fromJSON(steps.info.outputs.formula_dependencies), ' ') }}
if: always() && steps.install.outcome == 'success' && join(fromJSON(steps.info.outputs.formula_dependencies)) != ''
timeout-minutes: 30

- name: Uninstall cask dependencies
run: |
brew uninstall --cask ${{ join(fromJSON(steps.info.outputs.cask_dependencies), ' ') }}
Expand Down
4 changes: 4 additions & 0 deletions audit_exceptions/github_prerelease_allowlist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"voicevox-dev": "all",
"voicevox-preview": "all"
}

0 comments on commit 5d793a8

Please sign in to comment.