diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cbefc4..ae2ce8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} @@ -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 @@ -82,7 +64,7 @@ jobs: with: core: false cask: true - test-bot: false + test-bot: true - name: Enable debug mode run: | @@ -90,22 +72,17 @@ jobs: 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 @@ -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' @@ -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 @@ -154,7 +120,7 @@ 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 }} @@ -162,10 +128,9 @@ jobs: 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 @@ -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), ' ') }} diff --git a/audit_exceptions/github_prerelease_allowlist.json b/audit_exceptions/github_prerelease_allowlist.json new file mode 100644 index 0000000..cd68ac9 --- /dev/null +++ b/audit_exceptions/github_prerelease_allowlist.json @@ -0,0 +1,4 @@ +{ + "voicevox-dev": "all", + "voicevox-beta": "all" +}