mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Cleanup more GitHub Actions usage
Increase consistency between workflows, use more of our actions and `@main`.
This commit is contained in:
parent
c5d3a4a0ed
commit
3e4da13934
6
.github/workflows/docker.yml
vendored
6
.github/workflows/docker.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
|||||||
version: ["16.04", "18.04", "20.04"]
|
version: ["16.04", "18.04", "20.04"]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@main
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
@ -23,8 +23,8 @@ jobs:
|
|||||||
run: git fetch origin master
|
run: git fetch origin master
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: docker build -t brew --build-arg=version=${{matrix.version}} .
|
run: docker build -t brew --build-arg=version=${{matrix.version}} .
|
||||||
- name: Run brew test-bot
|
- name: Run brew test-bot --only-setup
|
||||||
run: docker run --rm brew brew test-bot
|
run: docker run --rm brew brew test-bot --only-setup
|
||||||
- name: Deploy the tagged Docker image to GitHub
|
- name: Deploy the tagged Docker image to GitHub
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
run: |
|
run: |
|
||||||
|
27
.github/workflows/doctor.yml
vendored
27
.github/workflows/doctor.yml
vendored
@ -8,6 +8,10 @@ on:
|
|||||||
- Library/Homebrew/extend/os/diagnostic.rb
|
- Library/Homebrew/extend/os/diagnostic.rb
|
||||||
- Library/Homebrew/extend/os/mac/diagnostic.rb
|
- Library/Homebrew/extend/os/mac/diagnostic.rb
|
||||||
- Library/Homebrew/os/mac/xcode.rb
|
- Library/Homebrew/os/mac/xcode.rb
|
||||||
|
env:
|
||||||
|
HOMEBREW_DEVELOPER: 1
|
||||||
|
HOMEBREW_GITHUB_ACTIONS: 1
|
||||||
|
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
strategy:
|
strategy:
|
||||||
@ -17,21 +21,10 @@ jobs:
|
|||||||
runs-on: ${{ matrix.version }}
|
runs-on: ${{ matrix.version }}
|
||||||
env:
|
env:
|
||||||
PATH: '/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'
|
PATH: '/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'
|
||||||
HOMEBREW_DEVELOPER: 1
|
|
||||||
HOMEBREW_NO_ANALYTICS: 1
|
|
||||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
|
||||||
steps:
|
steps:
|
||||||
- name: Update Homebrew
|
- name: Set up Homebrew
|
||||||
run: brew update-reset
|
id: set-up-homebrew
|
||||||
|
uses: Homebrew/actions/setup-homebrew@master
|
||||||
- name: Set up Git repository
|
|
||||||
run: |
|
|
||||||
cd $(brew --repo)
|
|
||||||
git clean -ffdx
|
|
||||||
git fetch --prune --force origin master
|
|
||||||
git fetch --prune --force origin ${{github.sha}}
|
|
||||||
git checkout --force ${{github.sha}}
|
|
||||||
git log -1
|
|
||||||
|
|
||||||
- name: Run brew test-bot --only-cleanup-before
|
- name: Run brew test-bot --only-cleanup-before
|
||||||
run: brew test-bot --only-cleanup-before
|
run: brew test-bot --only-cleanup-before
|
||||||
@ -42,9 +35,3 @@ jobs:
|
|||||||
- name: Run brew test-bot --only-cleanup-after
|
- name: Run brew test-bot --only-cleanup-after
|
||||||
if: always()
|
if: always()
|
||||||
run: brew test-bot --only-cleanup-after
|
run: brew test-bot --only-cleanup-after
|
||||||
|
|
||||||
- name: Cleanup
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
find .
|
|
||||||
rm -rf *
|
|
||||||
|
21
.github/workflows/spdx.yml
vendored
21
.github/workflows/spdx.yml
vendored
@ -1,31 +1,24 @@
|
|||||||
name: Update license data
|
name: Update license data
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- .github/workflows/spdx.yml
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 */12 * * *'
|
- cron: '0 */12 * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
spdx:
|
spdx:
|
||||||
if: github.repository == 'Homebrew/brew'
|
if: github.repository == 'Homebrew/brew'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
HOMEBREW_NO_ANALYTICS: 1
|
|
||||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Set up Homebrew
|
||||||
uses: actions/checkout@v2
|
id: set-up-homebrew
|
||||||
|
uses: Homebrew/actions/setup-homebrew@master
|
||||||
|
|
||||||
- name: Configure Git
|
- name: Configure Git user
|
||||||
uses: Homebrew/actions/git-user-config@master
|
uses: Homebrew/actions/git-user-config@master
|
||||||
with:
|
with:
|
||||||
username: BrewTestBot
|
username: BrewTestBot
|
||||||
|
|
||||||
- name: Setup Homebrew
|
|
||||||
run: |
|
|
||||||
HOMEBREW_REPOSITORY="$(brew --repo)"
|
|
||||||
rm -rf "$HOMEBREW_REPOSITORY"
|
|
||||||
ln -s "$GITHUB_WORKSPACE" "$HOMEBREW_REPOSITORY"
|
|
||||||
|
|
||||||
- name: Update license data
|
- name: Update license data
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
10
.github/workflows/tests.yml
vendored
10
.github/workflows/tests.yml
vendored
@ -4,6 +4,7 @@ on:
|
|||||||
branches: master
|
branches: master
|
||||||
pull_request: []
|
pull_request: []
|
||||||
env:
|
env:
|
||||||
|
HOMEBREW_DEVELOPER: 1
|
||||||
HOMEBREW_GITHUB_ACTIONS: 1
|
HOMEBREW_GITHUB_ACTIONS: 1
|
||||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||||
jobs:
|
jobs:
|
||||||
@ -18,6 +19,11 @@ jobs:
|
|||||||
id: set-up-homebrew
|
id: set-up-homebrew
|
||||||
uses: Homebrew/actions/setup-homebrew@master
|
uses: Homebrew/actions/setup-homebrew@master
|
||||||
|
|
||||||
|
- name: Configure Git user
|
||||||
|
uses: Homebrew/actions/git-user-config@master
|
||||||
|
with:
|
||||||
|
username: BrewTestBot
|
||||||
|
|
||||||
- name: Run brew test-bot --only-cleanup-before
|
- name: Run brew test-bot --only-cleanup-before
|
||||||
run: brew test-bot --only-cleanup-before
|
run: brew test-bot --only-cleanup-before
|
||||||
|
|
||||||
@ -29,7 +35,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Cache Bundler RubyGems
|
- name: Cache Bundler RubyGems
|
||||||
id: cache
|
id: cache
|
||||||
uses: actions/cache@master
|
uses: actions/cache@main
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
|
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
|
||||||
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
|
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
|
||||||
@ -91,8 +97,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Run brew update-tests
|
- name: Run brew update-tests
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "BrewTestBot"
|
|
||||||
git config --global user.email "homebrew-test-bot@lists.sfconservancy.org"
|
|
||||||
brew update-test
|
brew update-test
|
||||||
brew update-test --to-tag
|
brew update-test --to-tag
|
||||||
brew update-test --commit=HEAD
|
brew update-test --commit=HEAD
|
||||||
|
@ -58,24 +58,12 @@ module Homebrew
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macOS-latest]
|
os: [ubuntu-latest, macOS-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Update Homebrew
|
|
||||||
run: brew update
|
|
||||||
|
|
||||||
- name: Set up Git repository
|
|
||||||
uses: actions/checkout@master
|
|
||||||
|
|
||||||
- name: Set up Ruby
|
|
||||||
if: matrix.os == 'ubuntu-latest'
|
|
||||||
uses: actions/setup-ruby@main
|
|
||||||
with:
|
|
||||||
ruby-version: '2.6'
|
|
||||||
|
|
||||||
- name: Set up Homebrew
|
- name: Set up Homebrew
|
||||||
uses: Homebrew/actions/setup-homebrew@master
|
uses: Homebrew/actions/setup-homebrew@master
|
||||||
|
|
||||||
- name: Cache Homebrew Bundler RubyGems
|
- name: Cache Homebrew Bundler RubyGems
|
||||||
id: cache
|
id: cache
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@main
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
|
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
|
||||||
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
|
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user