52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
name: Scheduled online check
|
|
on:
|
|
push:
|
|
paths:
|
|
- .github/workflows/scheduled.yml
|
|
schedule:
|
|
# Once every day at 1AM
|
|
- cron: "0 1 * * *"
|
|
|
|
concurrency:
|
|
group: scheduled
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
create_matrix:
|
|
if: startsWith( github.repository, 'Homebrew/' )
|
|
runs-on: ubuntu-22.04
|
|
outputs:
|
|
json: ${{ steps.matrix.outputs.json }}
|
|
env:
|
|
TEST_COUNT: 20
|
|
TAP: homebrew/core
|
|
steps:
|
|
- name: Set up Homebrew
|
|
id: set-up-homebrew
|
|
uses: Homebrew/actions/setup-homebrew@master
|
|
- id: matrix
|
|
run: |
|
|
formula=$(find $(brew --repo "${TAP}")/Formula | shuf -n "${TEST_COUNT}" | xargs -I{} basename {} .rb)
|
|
json=$(brew info --json=v2 $formula | jq --compact-output '[.formulae[].name]')
|
|
echo "json=${json}" >> $GITHUB_OUTPUT
|
|
audit_online:
|
|
if: startsWith( github.repository, 'Homebrew/' )
|
|
runs-on: ubuntu-22.04
|
|
needs: create_matrix
|
|
name: "Online check: ${{ matrix.formula }}"
|
|
env:
|
|
HOMEBREW_GITHUB_API_TOKEN: "${{ github.token }}"
|
|
strategy:
|
|
matrix:
|
|
formula: ${{ fromJson(needs.create_matrix.outputs.json) }}
|
|
steps:
|
|
- name: Set up Homebrew
|
|
id: set-up-homebrew
|
|
uses: Homebrew/actions/setup-homebrew@master
|
|
|
|
- name: Check formula for missing upstreams etc.
|
|
run: brew audit --online --skip-style --only github_repository_archived,gitlab_repository_archived,homepage ${{ matrix.formula }}
|
|
|
|
- name: Check formula for missing sources.
|
|
run: brew fetch -s ${{ matrix.formula }}
|