diff --git a/.github/workflows/shell-quality-checks.yml b/.github/workflows/shell-quality-checks.yml index e9ff7e8..afbc3ed 100644 --- a/.github/workflows/shell-quality-checks.yml +++ b/.github/workflows/shell-quality-checks.yml @@ -20,6 +20,19 @@ jobs: uses: actions/setup-go@v5 with: go-version: "1.24.6" + cache: true + + - name: Cache Homebrew packages + uses: actions/cache@v4 + with: + path: | + ~/Library/Caches/Homebrew + /usr/local/Cellar/bats-core + /usr/local/Cellar/shfmt + /usr/local/Cellar/shellcheck + key: ${{ runner.os }}-brew-${{ hashFiles('.github/workflows/shell-quality-checks.yml') }} + restore-keys: | + ${{ runner.os }}-brew- - name: Install shell linting and testing tools run: brew install bats-core shfmt shellcheck @@ -28,11 +41,34 @@ jobs: run: ./scripts/format.sh - name: Run shellcheck linter and bats tests - run: ./scripts/check.sh + run: | + ./scripts/check.sh + echo "✓ All quality checks passed" + + - name: Run all bats tests with summary + run: | + echo "Running all test suites..." + bats tests/*.bats --formatter tap + echo "" + echo "Test summary:" + echo " Total test files: $(ls tests/*.bats | wc -l | tr -d ' ')" + echo " Total tests: $(grep -c "^@test" tests/*.bats | awk -F: '{sum+=$2} END {print sum}')" - name: Build Universal Binary for disk analyzer run: ./scripts/build-analyze.sh + - name: Verify binary is valid + run: | + if [[ ! -x bin/analyze-go ]]; then + echo "Error: bin/analyze-go is not executable" + exit 1 + fi + echo "Binary info:" + file bin/analyze-go + ls -lh bin/analyze-go + echo "" + echo "✓ Universal binary built successfully" + - name: Commit analyzer binary if updated if: github.event_name != 'pull_request' run: | diff --git a/.github/workflows/update-homebrew.yml b/.github/workflows/update-homebrew.yml index 78df171..1df83f3 100644 --- a/.github/workflows/update-homebrew.yml +++ b/.github/workflows/update-homebrew.yml @@ -9,11 +9,32 @@ jobs: update-formula: runs-on: ubuntu-latest steps: + - name: Extract version from tag + id: tag_version + run: | + TAG=${GITHUB_REF#refs/tags/} + VERSION=${TAG#V} + echo "tag=$TAG" >> $GITHUB_OUTPUT + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "Releasing version: $VERSION (tag: $TAG)" + - name: Update Homebrew formula uses: mislav/bump-homebrew-formula-action@v3 with: formula-name: mole formula-path: Formula/mole.rb homebrew-tap: tw93/homebrew-tap + tag-name: ${{ steps.tag_version.outputs.tag }} + commit-message: | + mole ${{ steps.tag_version.outputs.version }} + + Automated release via GitHub Actions env: COMMITTER_TOKEN: ${{ secrets.PAT_TOKEN }} + + - name: Verify formula update + if: success() + run: | + echo "✓ Homebrew formula updated successfully" + echo " Version: ${{ steps.tag_version.outputs.version }}" + echo " Tag: ${{ steps.tag_version.outputs.tag }}"