Skip to content

Commit

Permalink
Merge pull request #38 from keynslug/feat/EMQX-13447/otp-27
Browse files Browse the repository at this point in the history
ci: test and release builds under Erlang/OTP 26 / 27
  • Loading branch information
keynslug authored Jan 9, 2025
2 parents bdca875 + ef749ea commit 0cfba04
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 41 deletions.
62 changes: 23 additions & 39 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,52 +15,34 @@ jobs:
fail-fast: false
matrix:
otp:
- 25.3.2-2
- 26.2.1-2
- "26"
- "27"
rebar3:
- "3.22.0"
os:
- macos-14
- macos-13
- macos-15
runs-on: ${{ matrix.os }}
steps:
- name: prepare
- name: prepare erlang
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
run: |
brew install curl zip unzip gnu-sed kerl wget
git config --global credential.helper store
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: cache
with:
path: ~/.kerl/${{ matrix.otp }}
key: otp-install-${{ matrix.otp }}-${{ matrix.os }}
brew update
brew install erlang@${{ matrix.otp }}
echo "$(brew --prefix erlang@${{ matrix.otp }})/bin" >> $GITHUB_PATH
- name: build erlang
if: steps.cache.outputs.cache-hit != 'true'
timeout-minutes: 60
env:
OTP: ${{ matrix.otp }}
- name: install rebar3
run: |
set -eux
if [ ! -d $HOME/.kerl/$OTP ]; then
kerl build git https://github.com/emqx/otp.git OTP-$OTP $OTP
kerl install $OTP $HOME/.kerl/$OTP
fi
wget https://github.com/erlang/rebar3/releases/download/${{ matrix.rebar3 }}/rebar3 && chmod +x rebar3
sudo mv rebar3 /usr/local/bin/ && sudo chmod +x /usr/local/bin/rebar3
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
ref: ${{ github.event.inputs.ref }}

- name: install rebar3
run: |
set -eux
REBAR=$(brew --prefix)/bin/rebar3
if [ ! -f $REBAR ]; then
wget https://s3.amazonaws.com/rebar3/rebar3 -O $REBAR
chmod +x $REBAR
fi
- name: build
run: |
. $HOME/.kerl/${{ matrix.otp }}/activate
BUILD_RELEASE=1 make
run: env BUILD_RELEASE=1 make

- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
Expand All @@ -73,9 +55,11 @@ jobs:
strategy:
fail-fast: false
matrix:
otp:
- 25.3.2-2
- 26.2.1-2
erlang:
- otp: "26.2.5.2"
builder: "5.4-3:1.15.7-26.2.5.2-2"
- otp: "27.2"
builder: "5.4-3:1.17.3-27.2-1"
arch:
- amd64
- arm64
Expand Down Expand Up @@ -105,7 +89,7 @@ jobs:
# for github actions
- name: build
env:
IMAGE: ghcr.io/emqx/emqx-builder/5.3-5:1.15.7-${{ matrix.otp }}-${{ matrix.os }}
IMAGE: ghcr.io/emqx/emqx-builder/${{ matrix.erlang.builder }}-${{ matrix.os }}
run: >-
docker run --rm -v ${PWD}:/wd ${IMAGE} bash -euc "
git config --global --add safe.directory '*';
Expand All @@ -115,14 +99,14 @@ jobs:
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: startsWith(github.ref, 'refs/tags/')
with:
name: erlang-rocksdb-nif-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.otp }}
name: erlang-rocksdb-nif-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.erlang.otp }}
path: |
_packages/*.gz
_packages/*.gz.sha256
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') && github.eventname != 'workflow_dispatch'
if: startsWith(github.ref, 'refs/tags/')
needs:
- mac
- linux
Expand Down
30 changes: 28 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,40 @@ on:
pull_request:

jobs:
macos:
strategy:
matrix:
otp:
- "27"
rebar3:
- "3.22.0"
runs-on: macos-15
steps:
- name: prepare
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
run: |
brew update
brew install erlang@${{ matrix.otp }}
echo "$(brew --prefix erlang@${{ matrix.otp }})/bin" >> $GITHUB_PATH
- name: install rebar3
run: |
wget https://github.com/erlang/rebar3/releases/download/${{ matrix.rebar3 }}/rebar3 && chmod +x rebar3
sudo mv rebar3 /usr/local/bin/ && sudo chmod +x /usr/local/bin/rebar3
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
submodules: recursive
- name: test build
run: make

linux:
strategy:
fail-fast: false
matrix:
builder:
- 5.3-5:1.15.7-26.2.1-2
- 5.4-3:1.17.3-27.2-1
os:
- ubuntu24.04

runs-on: ubuntu-24.04

container: ghcr.io/emqx/emqx-builder/${{ matrix.builder }}-${{ matrix.os }}
Expand Down

0 comments on commit 0cfba04

Please sign in to comment.