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:
|
2019-12-20 16:37:06 +08:00
|
|
|
runs-on: macos-latest
|
2019-08-13 10:26:50 +08:00
|
|
|
steps:
|
2020-06-10 22:14:49 +08:00
|
|
|
- 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}"
|
2019-08-14 12:47:01 +08:00
|
|
|
|
|
|
|
# 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
|
|
|
|
2020-06-10 22:14:49 +08:00
|
|
|
cd "$(brew --repository "${GITHUB_REPOSITORY}")"
|
|
|
|
patch="$(mktemp)"
|
2020-06-11 07:23:21 +08:00
|
|
|
curl --silent --show-error --fail --location "${PR_URL}.patch" --output "${patch}"
|
2020-07-17 05:44:48 +08:00
|
|
|
git config --global user.name github-actions
|
|
|
|
git config --global user.email github-actions@github.com
|
2020-06-10 22:14:49 +08:00
|
|
|
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
|