Skip to content

Commit

Permalink
asdf
Browse files Browse the repository at this point in the history
  • Loading branch information
nix6839 committed Jun 7, 2024
1 parent 041e6b8 commit 8e27717
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 63 deletions.
85 changes: 22 additions & 63 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,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 +45,13 @@ jobs:

- name: Generate CI matrix
id: generate-matrix
# https://github.com/Homebrew/homebrew-cask/commit/a6ca6ea1a8d1e68bebd0e8eafa826bdeadad60f5#diff-4b269f1b86d1d59eb9f29fa0c077f805e2f3243259b1073ed6ccc4e53cdad88e
run: |
brew ruby -- "$(brew --repository homebrew/cask)/cmd/lib/generate-matrix.rb" "${{ github.event.pull_request.url }}"
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,30 +64,25 @@ jobs:
with:
core: false
cask: true
test-bot: false
test-bot: true

- name: Enable debug mode
run: |
echo 'HOMEBREW_DEBUG=1' >> "${GITHUB_ENV}"
echo 'HOMEBREW_VERBOSE=1' >> "${GITHUB_ENV}"
if: runner.debug

- name: Check out Pull Request
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- 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 +93,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 +108,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 +120,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 +217,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-beta": "all"
}

0 comments on commit 8e27717

Please sign in to comment.