Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use emqx/setup-otp action on macos #186

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 10 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ jobs:
fail-fast: false
matrix:
os:
- macos-12-arm64
- macos-12
- macos-11
otp:
- 24
- 25
- 25.1.2-2
- 24.3.4.2-2

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
Expand All @@ -25,32 +27,16 @@ jobs:
~/Library/Caches/Homebrew/
~/Library/Caches/Homebrew/downloads/
key: brew-${{ matrix.os }}-${{ matrix.otp }}
- name: prepare
run: |
#brew update
brew install erlang@${{ matrix.otp }}
- name: install rebar3
run: |
wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
cp ./rebar3 /usr/local/bin/rebar3
- uses: emqx/[email protected]
with:
os: ${{ matrix.os }}
otp: ${{ matrix.otp }}
- name: release build
run: |
export PATH="/usr/local/opt/erlang@${{ matrix.otp }}/bin:$PATH"
erl -eval 'erlang:display(erlang:system_info(system_version)),halt()'
ulimit -c unlimited
# run sudo for getting coredump
sudo make ci

- name: lldb bt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to keep this for troubleshooting if coredump happens.

if: failure()
run: |
corefile=$(find /cores -name 'core.*')
if [ -n $corefile ]; then
sudo lldb --one-line bt $(erl -noshell -eval 'io:format(code:root_dir()),halt()')/erts-*/bin/beam.smp -c "${corefile}"
else
echo "No coredump found"
fi

make build-nif
make ci
- name: Archive CT Logs
uses: actions/upload-artifact@v2
if: failure()
Expand Down
28 changes: 4 additions & 24 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,23 @@ jobs:
- 25.1.2-2
- 24.3.4.2-2
os:
- macos-12-arm64
- macos-12
- macos-11
runs-on: ${{ matrix.os }}
steps:
- name: prepare
run: |
# brew update
brew install curl zip unzip gnu-sed kerl
echo "/usr/local/bin" >> $GITHUB_PATH
git config --global credential.helper store
- uses: actions/cache@v3
id: cache
- uses: emqx/setup-otp@v1
with:
path: ~/.kerl/${{ matrix.otp }}
key: otp-install-${{ matrix.otp }}-${{ matrix.os }}

- name: build erlang
if: steps.cache.outputs.cache-hit != 'true'
timeout-minutes: 60
run: |
kerl update releases
kerl build git https://github.com/emqx/otp.git OTP-${{ matrix.otp }} ${{ matrix.otp }}
kerl install ${{ matrix.otp }} $HOME/.kerl/${{ matrix.otp }}
os: ${{ matrix.os }}
otp: ${{ matrix.otp }}

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: install rebar3
run: |
wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
cp ./rebar3 /usr/local/bin/rebar3

- name: build release
if: startsWith(github.ref, 'refs/tags/')
run: |
. $HOME/.kerl/${{ matrix.otp }}/activate
BUILD_RELEASE=1 make

- uses: actions/upload-artifact@v3
Expand Down