| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- name: Build slim packages
- concurrency:
- group: slim-${{ github.event_name }}-${{ github.ref }}
- cancel-in-progress: true
- on:
- push:
- branches:
- - master
- pull_request:
- # GitHub pull_request action is by default triggered when
- # opened reopened or synchronize,
- # we add labeled and unlabeled to the list because
- # the mac job dpends on the PR having a 'Mac' label
- types:
- - labeled
- - unlabeled
- - opened
- - reopened
- - synchronize
- workflow_dispatch:
- jobs:
- linux:
- runs-on: aws-amd64
- strategy:
- fail-fast: false
- matrix:
- profile:
- - emqx
- - emqx-enterprise
- otp:
- - 24.2.1-1
- elixir:
- - 1.13.4
- os:
- - ubuntu20.04
- - el8
- container: "ghcr.io/emqx/emqx-builder/5.0-16:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}"
- steps:
- - uses: AutoModality/action-clean@v1
- - uses: actions/checkout@v2
- with:
- fetch-depth: 0
- - name: prepare
- run: |
- echo "EMQX_NAME=${{ matrix.profile }}" >> $GITHUB_ENV
- echo "CODE_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- - name: Work around https://github.com/actions/checkout/issues/766
- run: |
- git config --global --add safe.directory "$GITHUB_WORKSPACE"
- - name: build and test tgz package
- run: |
- make ${EMQX_NAME}-tgz
- ./scripts/pkg-tests.sh ${EMQX_NAME}-tgz
- - name: run static checks
- if: contains(matrix.os, 'ubuntu')
- run: |
- make static_checks
- - name: build and test deb/rpm packages
- run: |
- make ${EMQX_NAME}-pkg
- ./scripts/pkg-tests.sh ${EMQX_NAME}-pkg
- - name: build and test tgz package (Elixir)
- run: |
- make ${EMQX_NAME}-elixir-tgz
- ./scripts/pkg-tests.sh ${EMQX_NAME}-elixir-tgz
- - name: build and test deb/rpm packages (Elixir)
- run: |
- make ${EMQX_NAME}-elixir-pkg
- ./scripts/pkg-tests.sh ${EMQX_NAME}-elixir-pkg
- - uses: actions/upload-artifact@v2
- with:
- name: ${{ matrix.profile}}-${{ matrix.otp }}-${{ matrix.os }}
- path: _packages/${{ matrix.profile}}/*.tar.gz
- - uses: actions/upload-artifact@v2
- with:
- name: "${{ matrix.profile }}_schema_dump"
- path: _build/*/lib/emqx_dashboard/priv/www/static/schema.json
- windows:
- runs-on: windows-2019
- strategy:
- fail-fast: false
- matrix:
- profile:
- - emqx
- otp:
- - 24.2.1
- steps:
- - uses: actions/checkout@v2
- - uses: ilammy/msvc-dev-cmd@v1
- - uses: erlef/setup-beam@v1
- with:
- otp-version: ${{ matrix.otp }}
- - name: build
- env:
- PYTHON: python
- DIAGNOSTIC: 1
- run: |
- # ensure crypto app (openssl)
- erl -eval "erlang:display(crypto:info_lib())" -s init stop
- make ${{ matrix.profile }}-tgz
- - name: run emqx
- timeout-minutes: 5
- run: |
- ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx start
- Start-Sleep -s 5
- echo "EMQX started"
- ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx stop
- echo "EMQX stopped"
- ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx install
- echo "EMQX installed"
- ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx uninstall
- echo "EMQX uninstalled"
- mac:
- strategy:
- fail-fast: false
- matrix:
- profile:
- - emqx
- - emqx-enterprise
- otp:
- - 24.2.1-1
- macos:
- - macos-11
- - macos-10.15
- runs-on: ${{ matrix.macos }}
- steps:
- - uses: actions/checkout@v2
- - name: prepare
- run: |
- brew update
- brew install curl zip unzip kerl coreutils
- echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH
- echo "/usr/local/bin" >> $GITHUB_PATH
- echo "EMQX_NAME=${{ matrix.profile }}" >> $GITHUB_ENV
- echo "BUILD_WITH_QUIC=1" >> $GITHUB_ENV
- - uses: actions/cache@v2
- id: cache
- with:
- path: ~/.kerl/${{ matrix.otp }}
- key: otp-install-${{ matrix.otp }}-${{ matrix.macos }}
- - name: build erlang
- if: steps.cache.outputs.cache-hit != 'true'
- timeout-minutes: 60
- env:
- KERL_BUILD_BACKEND: git
- OTP_GITHUB_URL: https://github.com/emqx/otp
- run: |
- kerl update releases
- kerl build ${{ matrix.otp }}
- kerl install ${{ matrix.otp }} $HOME/.kerl/${{ matrix.otp }}
- - name: build ${{ matrix.profile }}
- env:
- AUTO_INSTALL_BUILD_DEPS: 1
- run: |
- . $HOME/.kerl/${{ matrix.otp }}/activate
- make ensure-rebar3
- sudo cp rebar3 /usr/local/bin/rebar3
- make ${{ matrix.profile }}-tgz
- - name: test
- run: |
- pkg_name=$(find _packages/${{ matrix.profile }} -mindepth 1 -maxdepth 1 -iname \*.tar.gz)
- mkdir -p emqx
- tar -C emqx -zxf $pkg_name
- # gsed -i '/emqx_telemetry/d' ./emqx/data/loaded_plugins
- ./emqx/bin/emqx start || cat emqx/log/erlang.log.1
- ready='no'
- for i in {1..30}; do
- if curl -fs 127.0.0.1:18083/api/v5/status > /dev/null; then
- ready='yes'
- break
- fi
- sleep 1
- done
- if [ "$ready" != "yes" ]; then
- echo "Timed out waiting for emqx to be ready"
- cat emqx/log/erlang.log.1
- exit 1
- fi
- ./emqx/bin/emqx_ctl status
- ./emqx/bin/emqx stop
- rm -rf emqx
- - uses: actions/upload-artifact@v2
- with:
- name: macos
- path: _packages/**/*.tar.gz
- spellcheck:
- needs: linux
- strategy:
- matrix:
- profile:
- - emqx
- - emqx-enterprise
- runs-on: aws-amd64
- container: "ghcr.io/emqx/emqx-schema-validate:0.3.3"
- steps:
- - uses: actions/download-artifact@v2
- name: Download schema dump
- with:
- name: "${{ matrix.profile }}_schema_dump"
- path: /tmp/
- - name: Run spellcheck
- run: |
- cd /LanguageTool
- bash start.sh > /dev/null &
- ./emqx_schema_validate /tmp/${{ matrix.profile }}/lib/emqx_dashboard/priv/www/static/schema.json
- allgood_packaging:
- runs-on: ubuntu-latest
- needs:
- - linux
- - windows
- - mac
- steps:
- - name: Check if all packging builds succeeded
- uses: re-actors/alls-green@release/v1
- with:
- #allowed-failures:
- #allowed-skips:
- jobs: ${{ toJSON(needs) }}
|