Skip to content

Commit

Permalink
.github/workflows: add more concurrency.
Browse files Browse the repository at this point in the history
Set `concurrency` on all workflows where it makes sense to do so.
  • Loading branch information
MikeMcQuaid committed Jul 9, 2021
1 parent 2707780 commit 29b740f
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 59 deletions.
88 changes: 47 additions & 41 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,59 @@
name: Scheduled regeneration

on:
push:
paths:
- .github/workflows/scheduled.yml
schedule:
# Once every hour
- cron: '30 * * * *'
- cron: "30 * * * *"

concurrency:
group: scheduled
cancel-in-progress: true

jobs:
generate:
if: startsWith( github.repository, 'Homebrew/' )
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@main
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Set up Ruby
uses: actions/setup-ruby@main
with:
ruby-version: '2.6'

- name: Install RubyGems
run: |
gem install bundler -v "~>1"
bundle install --jobs 4 --retry 3
- name: Configure Git user
uses: Homebrew/actions/git-user-config@master
with:
username: BrewTestBot

- name: Generate site
run: |
ln -s $(brew --repo) brew
bundle exec rake yard build
- name: Commit changes
run: |
git reset origin/master
git add docs
if ! git diff --no-patch --exit-code HEAD -- docs; then
git commit -m "docs: updates from Homebrew/brew" docs
fi
- name: Push commits
uses: Homebrew/actions/git-try-push@master
- name: Set up Git repository
uses: actions/checkout@main
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Set up Ruby
uses: actions/setup-ruby@main
with:
ruby-version: "2.6"

- name: Install RubyGems
run: |
gem install bundler -v "~>1"
bundle install --jobs 4 --retry 3
- name: Configure Git user
uses: Homebrew/actions/git-user-config@master
with:
username: BrewTestBot

- name: Generate site
run: |
ln -s $(brew --repo) brew
bundle exec rake yard build
- name: Commit changes
run: |
git reset origin/master
git add docs
if ! git diff --no-patch --exit-code HEAD -- docs; then
git commit -m "docs: updates from Homebrew/brew" docs
fi
- name: Push commits
uses: Homebrew/actions/git-try-push@master
42 changes: 24 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
name: GitHub Actions CI
on:
push:
branches: master
branches:
- master
pull_request:

concurrency:
group: "${{ github.ref }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@main
- name: Set up Git repository
uses: actions/checkout@main

- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Set up Ruby
uses: actions/setup-ruby@main
with:
ruby-version: '2.6'
- name: Set up Ruby
uses: actions/setup-ruby@main
with:
ruby-version: "2.6"

- name: Install RubyGems
run: |
gem install bundler -v "~>1"
bundle install --jobs 4 --retry 3
- name: Install RubyGems
run: |
gem install bundler -v "~>1"
bundle install --jobs 4 --retry 3
- name: Generate site
run: |
ln -s $(brew --repo) brew
bundle exec rake yard build
- name: Generate site
run: |
ln -s $(brew --repo) brew
bundle exec rake yard build

0 comments on commit 29b740f

Please sign in to comment.