homebrew-cask/.github/workflows/ci.yml

44 lines
1.3 KiB
YAML
Raw Normal View History

2019-08-13 10:26:50 +08:00
name: CI
2019-08-13 11:00:51 +08:00
on:
- pull_request
2019-08-13 10:26:50 +08:00
jobs:
ci:
runs-on: macos-latest
2019-08-13 10:26:50 +08:00
steps:
- name: Check out Pull Request
2019-08-13 17:02:53 +08:00
run: |
brew update-reset "$(brew --repository)"
2019-10-15 01:29:14 +08:00
HOMEBREW_INSTALL_BUNDLER_GEMS_FIRST=1 brew config
2019-08-13 17:02:53 +08:00
brew tap "${GITHUB_REPOSITORY}"
# Get latest version of `brew cask ci` command.
if [ "${GITHUB_REPOSITORY}" != Homebrew/homebrew-cask ]; then
brew update-reset "$(brew --repository homebrew/cask)"
fi
2019-08-13 17:02:53 +08:00
brew update-reset "$(brew --repository "${GITHUB_REPOSITORY}")"
2020-07-22 00:23:09 +08:00
cd "$(brew --repository "${GITHUB_REPOSITORY}")"
patch="$(mktemp)"
curl --silent --show-error --fail --location "${PR_URL}.patch" --output "${patch}"
git config --global user.name github-actions
git config --global user.email github-actions@github.com
git am --whitespace=nowarn "${patch}"
rm "${patch}"
2019-08-13 17:02:53 +08:00
env:
PR_URL: ${{ github.event.pull_request._links.html.href }}
HOMEBREW_COLOR: 1
HOMEBREW_DEVELOPER: 1
- name: brew cask ci
run: |
cd "$(brew --repository "${GITHUB_REPOSITORY}")"
2020-03-06 00:33:54 +08:00
unset HOMEBREW_CASK_OPTS
2019-08-13 17:02:53 +08:00
brew cask ci
env:
HOMEBREW_COLOR: 1
HOMEBREW_DEVELOPER: 1