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"]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
uses: actions/checkout@main
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
@ -23,8 +23,8 @@ jobs:
|
||||
run: git fetch origin master
|
||||
- name: Build Docker image
|
||||
run: docker build -t brew --build-arg=version=${{matrix.version}} .
|
||||
- name: Run brew test-bot
|
||||
run: docker run --rm brew brew test-bot
|
||||
- name: Run brew test-bot --only-setup
|
||||
run: docker run --rm brew brew test-bot --only-setup
|
||||
- name: Deploy the tagged Docker image to GitHub
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
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/mac/diagnostic.rb
|
||||
- Library/Homebrew/os/mac/xcode.rb
|
||||
env:
|
||||
HOMEBREW_DEVELOPER: 1
|
||||
HOMEBREW_GITHUB_ACTIONS: 1
|
||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||
jobs:
|
||||
tests:
|
||||
strategy:
|
||||
@ -17,21 +21,10 @@ jobs:
|
||||
runs-on: ${{ matrix.version }}
|
||||
env:
|
||||
PATH: '/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'
|
||||
HOMEBREW_DEVELOPER: 1
|
||||
HOMEBREW_NO_ANALYTICS: 1
|
||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||
steps:
|
||||
- name: Update Homebrew
|
||||
run: brew update-reset
|
||||
|
||||
- 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: Set up Homebrew
|
||||
id: set-up-homebrew
|
||||
uses: Homebrew/actions/setup-homebrew@master
|
||||
|
||||
- name: 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
|
||||
if: always()
|
||||
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
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/spdx.yml
|
||||
schedule:
|
||||
- cron: '0 */12 * * *'
|
||||
|
||||
jobs:
|
||||
spdx:
|
||||
if: github.repository == 'Homebrew/brew'
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
HOMEBREW_NO_ANALYTICS: 1
|
||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Homebrew
|
||||
id: set-up-homebrew
|
||||
uses: Homebrew/actions/setup-homebrew@master
|
||||
|
||||
- name: Configure Git
|
||||
- name: Configure Git user
|
||||
uses: Homebrew/actions/git-user-config@master
|
||||
with:
|
||||
username: BrewTestBot
|
||||
|
||||
- name: Setup Homebrew
|
||||
run: |
|
||||
HOMEBREW_REPOSITORY="$(brew --repo)"
|
||||
rm -rf "$HOMEBREW_REPOSITORY"
|
||||
ln -s "$GITHUB_WORKSPACE" "$HOMEBREW_REPOSITORY"
|
||||
|
||||
- name: Update license data
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
10
.github/workflows/tests.yml
vendored
10
.github/workflows/tests.yml
vendored
@ -4,6 +4,7 @@ on:
|
||||
branches: master
|
||||
pull_request: []
|
||||
env:
|
||||
HOMEBREW_DEVELOPER: 1
|
||||
HOMEBREW_GITHUB_ACTIONS: 1
|
||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||
jobs:
|
||||
@ -18,6 +19,11 @@ jobs:
|
||||
id: set-up-homebrew
|
||||
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
|
||||
run: brew test-bot --only-cleanup-before
|
||||
|
||||
@ -29,7 +35,7 @@ jobs:
|
||||
|
||||
- name: Cache Bundler RubyGems
|
||||
id: cache
|
||||
uses: actions/cache@master
|
||||
uses: actions/cache@main
|
||||
with:
|
||||
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
|
||||
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
|
||||
@ -91,8 +97,6 @@ jobs:
|
||||
|
||||
- name: Run brew update-tests
|
||||
run: |
|
||||
git config --global user.name "BrewTestBot"
|
||||
git config --global user.email "homebrew-test-bot@lists.sfconservancy.org"
|
||||
brew update-test
|
||||
brew update-test --to-tag
|
||||
brew update-test --commit=HEAD
|
||||
|
@ -58,24 +58,12 @@ module Homebrew
|
||||
matrix:
|
||||
os: [ubuntu-latest, macOS-latest]
|
||||
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
|
||||
uses: Homebrew/actions/setup-homebrew@master
|
||||
|
||||
- name: Cache Homebrew Bundler RubyGems
|
||||
id: cache
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@main
|
||||
with:
|
||||
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
|
||||
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user