feat: add qrca as system flatpak #32
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validate Brewfiles | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| paths: | |
| - "system_files/shared/usr/share/ublue-os/homebrew/**" | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Set up Homebrew | |
| uses: Homebrew/actions/setup-homebrew@main | |
| - name: Validate Brewfiles | |
| shell: bash | |
| run: | | |
| echo "Validating Brewfiles in homebrew directory..." | |
| STATUS_FILE=$(mktemp) | |
| echo "PASS" > "$STATUS_FILE" | |
| while IFS= read -r -d '' brewfile ; do | |
| echo "::group:: ===$(basename $brewfile)===" | |
| grep -E -e "^tap" "$brewfile" > taps.Brewfile || true | |
| echo "Syncing taps..." | |
| brew bundle --file=./taps.Brewfile > /dev/null 2>&1 || true | |
| # Extract combined list for parallel check | |
| FORMULAS=$(grep -E '^\s*brew\s+["'\'']' "$brewfile" | sed -E 's/^\s*brew\s+["'\'']([^"'\'']+)["'\''].*/formula \1/' || true) | |
| CASKS=$(grep -E '^\s*cask\s+["'\'']' "$brewfile" | sed -E 's/^\s*cask\s+["'\'']([^"'\'']+)["'\''].*/cask \1/' || true) | |
| ENTRIES=$(printf "%s\n%s" "$FORMULAS" "$CASKS" | grep -v '^\s*$' || true) | |
| if [ -n "$ENTRIES" ]; then | |
| echo "$ENTRIES" | xargs -P 8 -I {} bash -c ' | |
| TYPE=$(echo "{}" | cut -d" " -f1) | |
| NAME=$(echo "{}" | cut -d" " -f2) | |
| if ! brew info --$TYPE "$NAME" &> /dev/null; then | |
| echo "✗ $TYPE \"$NAME\" is invalid or missing tap" | |
| echo "FAIL" >> "'"$STATUS_FILE"'" | |
| else | |
| echo "✓ $TYPE \"$NAME\" is valid" | |
| fi | |
| ' | |
| else | |
| echo "No formulas or casks found." | |
| fi | |
| echo "::endgroup::" | |
| done < <(find "system_files/shared/usr/share/ublue-os/homebrew" -iname '*\.Brewfile*' -print0) | |
| rm -f taps.Brewfile | |
| if grep -q "FAIL" "$STATUS_FILE"; then | |
| echo "Validation complete. Some Brewfiles FAILED." | |
| exit 1 | |
| else | |
| echo "Validation complete. All Brewfiles PASSED." | |
| exit 0 | |
| fi |