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.3.4.2-1 elixir: - 1.13.4 os: - ubuntu20.04 - el8 container: "ghcr.io/emqx/emqx-builder/5.0-18:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}" steps: - uses: AutoModality/action-clean@v1 - uses: actions/checkout@v3 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@v3 with: name: ${{ matrix.profile}}-${{ matrix.otp }}-${{ matrix.os }} path: _packages/${{ matrix.profile}}/* - uses: actions/upload-artifact@v3 with: name: "${{ matrix.profile }}_schema_dump" path: | scripts/spellcheck _build/${{ matrix.profile }}/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@v3 - uses: ilammy/msvc-dev-cmd@v1.12.0 - 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" - uses: actions/upload-artifact@v3 with: name: windows path: _packages/${{ matrix.profile}}/* mac: strategy: fail-fast: false matrix: profile: - emqx - emqx-enterprise otp: - 24.3.4.2-1 os: - macos-11 - macos-12-arm64 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - name: prepare run: | echo "EMQX_NAME=${{ matrix.profile }}" >> $GITHUB_ENV - uses: ./.github/actions/package-macos with: profile: ${{ matrix.profile }} otp: ${{ matrix.otp }} os: ${{ matrix.os }} apple_id_password: ${{ secrets.APPLE_ID_PASSWORD }} apple_developer_identity: ${{ secrets.APPLE_DEVELOPER_IDENTITY }} apple_developer_id_bundle: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE }} apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }} - uses: actions/upload-artifact@v3 with: name: ${{ matrix.os }} path: _packages/**/* spellcheck: needs: linux strategy: matrix: profile: - emqx - emqx-enterprise runs-on: aws-amd64 steps: - uses: actions/download-artifact@v3 name: Download schema dump with: name: "${{ matrix.profile }}_schema_dump" path: /tmp/ - name: Run spellcheck run: | bash /tmp/scripts/spellcheck/spellcheck.sh /tmp/_build/${{ 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) }}