2019-11-12 21:48:05 -08:00
|
|
|
name: macOS
|
2020-02-26 12:52:07 +09:00
|
|
|
on: [push, pull_request]
|
2019-08-08 08:28:49 -07:00
|
|
|
jobs:
|
2019-11-12 20:44:00 -08:00
|
|
|
make:
|
2019-08-08 08:28:49 -07:00
|
|
|
runs-on: macos-latest
|
2019-08-11 06:26:17 +09:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-02-26 13:17:08 +09:00
|
|
|
test_task: [ "check", "test-bundler", "test-bundled-gems", "leaked-globals" ]
|
2019-08-17 09:43:05 +09:00
|
|
|
fail-fast: false
|
2019-10-09 17:46:05 +09:00
|
|
|
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
2019-08-08 08:28:49 -07:00
|
|
|
steps:
|
|
|
|
- name: Disable Firewall
|
|
|
|
run: |
|
|
|
|
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
|
|
|
|
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
|
2019-08-14 09:23:57 +09:00
|
|
|
# Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
|
2020-01-06 01:52:19 -08:00
|
|
|
- name: Checkout ruby
|
2019-10-28 18:31:00 +09:00
|
|
|
run: |
|
2020-01-11 16:24:16 +09:00
|
|
|
git clone --single-branch --shallow-since=yesterday --branch=${GITHUB_REF#refs/heads/} https://github.com/${{ github.repository }} src
|
2019-10-28 18:31:00 +09:00
|
|
|
git -C src reset --hard "$GITHUB_SHA"
|
2019-08-14 09:23:57 +09:00
|
|
|
if: github.event_name == 'push'
|
|
|
|
- name: Checkout a pull request
|
2019-10-28 18:31:00 +09:00
|
|
|
run: |
|
2020-03-30 17:35:49 +09:00
|
|
|
git clone --single-branch --depth=50 --branch=${{ github.event.pull_request.head.ref }} https://github.com/${{ github.event.pull_request.head.repo.full_name }} src
|
2020-01-06 01:42:30 -08:00
|
|
|
git -C src reset --hard ${{ github.event.pull_request.head.sha }}
|
2019-08-14 09:23:57 +09:00
|
|
|
if: github.event_name == 'pull_request'
|
2019-11-13 13:22:46 +09:00
|
|
|
- run: ./src/tool/actions-commit-info.sh
|
2019-12-11 14:01:23 +09:00
|
|
|
id: commit_info
|
2019-09-17 16:59:47 +09:00
|
|
|
- name: Install libraries
|
|
|
|
run: |
|
|
|
|
export WAITS='5 60'
|
2020-02-20 00:13:44 +09:00
|
|
|
tool/travis_retry.sh brew upgrade
|
2019-09-17 16:59:47 +09:00
|
|
|
tool/travis_retry.sh brew install gdbm gmp libffi openssl@1.1 zlib autoconf automake libtool readline
|
2020-02-26 13:12:46 +09:00
|
|
|
working-directory: src
|
2019-08-08 08:28:49 -07:00
|
|
|
- name: Set ENV
|
|
|
|
run: |
|
2019-11-13 13:13:52 +09:00
|
|
|
echo '::set-env name=JOBS::'-j$((1 + $(sysctl -n hw.activecpu)))
|
2020-04-05 04:30:04 +09:00
|
|
|
- run: autoconf -I tool/m4
|
2020-02-26 13:12:46 +09:00
|
|
|
working-directory: src
|
|
|
|
- run: mkdir build
|
2020-03-02 10:59:30 +09:00
|
|
|
- name: Run configure
|
|
|
|
run: ../src/configure -C --disable-install-doc --with-openssl-dir=$(brew --prefix openssl@1.1) --with-readline-dir=$(brew --prefix readline)
|
2020-02-26 13:12:46 +09:00
|
|
|
working-directory: build
|
|
|
|
- run: make $JOBS
|
|
|
|
working-directory: build
|
2020-03-13 10:40:00 +01:00
|
|
|
- run: make prepare-gems
|
2020-02-26 13:12:46 +09:00
|
|
|
working-directory: build
|
2019-11-19 15:13:35 +09:00
|
|
|
if: matrix.test_task == 'check'
|
2020-02-26 13:12:46 +09:00
|
|
|
- run: make $JOBS -s ${{ matrix.test_task }}
|
|
|
|
working-directory: build
|
2019-08-11 06:26:17 +09:00
|
|
|
env:
|
2019-09-05 17:51:02 +09:00
|
|
|
RUBY_TESTOPTS: "-q --tty=no"
|
2019-12-30 23:09:24 -08:00
|
|
|
# Remove minitest from TEST_BUNDLED_GEMS_ALLOW_FAILURES if https://github.com/seattlerb/minitest/pull/798 is resolved
|
2020-03-24 15:36:53 +09:00
|
|
|
TEST_BUNDLED_GEMS_ALLOW_FAILURES: "minitest,xmlrpc,rexml"
|
2020-03-07 00:34:41 -08:00
|
|
|
- uses: k0kubun/action-slack@v2.0.0
|
|
|
|
with:
|
|
|
|
payload: |
|
|
|
|
{
|
|
|
|
"ci": "GitHub Actions",
|
|
|
|
"env": "${{ github.workflow }} / ${{ matrix.test_task }}",
|
|
|
|
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
2020-03-09 22:31:50 -07:00
|
|
|
"commit": "${{ github.sha }}",
|
|
|
|
"branch": "${{ github.ref }}".split('/').reverse()[0]
|
2020-03-07 00:34:41 -08:00
|
|
|
}
|
|
|
|
env:
|
2020-03-09 22:31:50 -07:00
|
|
|
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
2020-03-07 00:34:41 -08:00
|
|
|
if: failure() && github.event_name == 'push'
|