| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- name: Build docker image for test
- concurrency:
- group: docker-test-build-${{ github.event_name }}-${{ github.ref }}
- cancel-in-progress: true
- on:
- workflow_call:
- inputs:
- otp_vsn:
- required: true
- type: string
- elixir_vsn:
- required: true
- type: string
- version-emqx:
- required: true
- type: string
- version-emqx-enterprise:
- required: true
- type: string
- permissions:
- contents: read
- jobs:
- docker:
- runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
- env:
- EMQX_NAME: ${{ matrix.profile }}
- PKG_VSN: ${{ startsWith(matrix.profile, 'emqx-enterprise') && inputs.version-emqx-enterprise || inputs.version-emqx }}
- OTP_VSN: ${{ inputs.otp_vsn }}
- ELIXIR_VSN: ${{ inputs.elixir_vsn }}
- strategy:
- fail-fast: false
- matrix:
- profile:
- - emqx
- - emqx-enterprise
- - emqx-elixir
- - emqx-enterprise-elixir
- steps:
- - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- - name: build and export to Docker
- id: build
- run: |
- make ${EMQX_NAME}-docker
- echo "_EMQX_DOCKER_IMAGE_TAG=$(head -n 1 .emqx_docker_image_tags)" >> $GITHUB_ENV
- - name: smoke test
- run: |
- CID=$(docker run -d --rm -P $_EMQX_DOCKER_IMAGE_TAG)
- HTTP_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "18083/tcp") 0).HostPort}}' $CID)
- ./scripts/test/emqx-smoke-test.sh localhost $HTTP_PORT
- docker stop $CID
- - name: export docker image
- run: |
- docker save $_EMQX_DOCKER_IMAGE_TAG | gzip > $EMQX_NAME-docker-$PKG_VSN.tar.gz
- - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
- with:
- name: "${{ env.EMQX_NAME }}-docker"
- path: "${{ env.EMQX_NAME }}-docker-${{ env.PKG_VSN }}.tar.gz"
- retention-days: 3
|