ci: fix docker and helm tests
This commit is contained in:
parent
28afa538d3
commit
f8022a849a
|
@ -35,39 +35,33 @@ jobs:
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
EMQX_NAME: ${{ matrix.profile[0] }}
|
EMQX_NAME: ${{ matrix.profile }}
|
||||||
OTP_VSN: 25.3.2-1
|
OTP_VSN: 25.3.2-1
|
||||||
ELIXIR_VSN: 1.14.5
|
ELIXIR_VSN: 1.14.5
|
||||||
PKG_VSN: ${{ matrix.profile[0] == 'emqx' && inputs.version-emqx || inputs.version-emqx-enterprise }}
|
PKG_VSN: ${{ matrix.profile == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }}
|
||||||
EMQX_IMAGE_TAG: emqx/${{ matrix.profile[0] }}:${{ matrix.profile[0] == 'emqx' && inputs.version-emqx || inputs.version-emqx-enterprise }}
|
|
||||||
EMQX_IMAGE_OLD_VERSION_TAG: emqx/${{ matrix.profile[0] }}:${{ matrix.profile[1] }}
|
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
profile:
|
profile:
|
||||||
- ["emqx", "5.0.16"]
|
- emqx
|
||||||
- ["emqx-elixir", "5.0.16"]
|
- emqx-enterprise
|
||||||
- ["emqx-enterprise", "5.0.1"]
|
- emqx-elixir
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: build and export to Docker
|
- name: build and export to Docker
|
||||||
id: build
|
id: build
|
||||||
run: |
|
run: |
|
||||||
make ${{ matrix.profile[0] }}-docker
|
make ${EMQX_NAME}-docker
|
||||||
echo "EMQX_IMAGE_TAG=$(cat .docker_image_tag)" >> $GITHUB_OUTPUT
|
echo "EMQX_IMAGE_TAG=$(cat .docker_image_tag)" >> $GITHUB_ENV
|
||||||
- name: smoke test
|
- name: smoke test
|
||||||
env:
|
|
||||||
EMQX_IMAGE_TAG: ${{ steps.build.outputs.EMQX_IMAGE_TAG }}
|
|
||||||
run: |
|
run: |
|
||||||
CID=$(docker run -d --rm -P $EMQX_IMAGE_TAG)
|
CID=$(docker run -d --rm -P $EMQX_IMAGE_TAG)
|
||||||
HTTP_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "18083/tcp") 0).HostPort}}' $CID)
|
HTTP_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "18083/tcp") 0).HostPort}}' $CID)
|
||||||
./scripts/test/emqx-smoke-test.sh localhost $HTTP_PORT
|
./scripts/test/emqx-smoke-test.sh localhost $HTTP_PORT
|
||||||
docker stop $CID
|
docker stop $CID
|
||||||
- name: export docker image
|
- name: export docker image
|
||||||
env:
|
|
||||||
EMQX_IMAGE_TAG: ${{ steps.build.outputs.EMQX_IMAGE_TAG }}
|
|
||||||
run: |
|
run: |
|
||||||
docker save $EMQX_IMAGE_TAG | gzip > $EMQX_NAME-docker-$PKG_VSN.tar.gz
|
docker save $EMQX_IMAGE_TAG | gzip > $EMQX_NAME-docker-$PKG_VSN.tar.gz
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
|
@ -75,8 +69,4 @@ jobs:
|
||||||
name: "${{ env.EMQX_NAME }}-docker"
|
name: "${{ env.EMQX_NAME }}-docker"
|
||||||
path: "${{ env.EMQX_NAME }}-docker-${{ env.PKG_VSN }}.tar.gz"
|
path: "${{ env.EMQX_NAME }}-docker-${{ env.PKG_VSN }}.tar.gz"
|
||||||
retention-days: 3
|
retention-days: 3
|
||||||
- name: cleanup
|
|
||||||
if: always()
|
|
||||||
working-directory: ./scripts/ui-tests
|
|
||||||
run: |
|
|
||||||
docker compose rm -fs
|
|
||||||
|
|
|
@ -23,26 +23,28 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
main:
|
main:
|
||||||
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }}
|
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }}
|
||||||
|
env:
|
||||||
|
EMQX_NAME: ${{ matrix.profile[0] }}
|
||||||
|
PKG_VSN: ${{ matrix.profile[0] == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }}
|
||||||
|
EMQX_IMAGE_OLD_VERSION_TAG: emqx/${{ matrix.profile[0] }}:${{ matrix.profile[1] }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
profile:
|
profile:
|
||||||
- emqx
|
- ["emqx", "5.0.16"]
|
||||||
- emqx-enterprise
|
- ["emqx-elixir", "5.0.16"]
|
||||||
- emqx-elixir
|
- ["emqx-enterprise", "5.0.1"]
|
||||||
steps:
|
steps:
|
||||||
- uses: AutoModality/action-clean@v1
|
- uses: AutoModality/action-clean@v1
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.profile }}-docker
|
name: ${{ matrix.profile[0] }}-docker
|
||||||
path: /tmp
|
path: /tmp
|
||||||
- name: load docker image
|
- name: load docker image
|
||||||
env:
|
|
||||||
PKG_VSN: ${{ inputs.version-emqx }}
|
|
||||||
run: |
|
run: |
|
||||||
EMQX_IMAGE_TAG=$(docker load < /tmp/emqx-docker-${PKG_VSN}.tar.gz | sed 's/Loaded image: //g')
|
EMQX_IMAGE_TAG=$(docker load < /tmp/${EMQX_NAME}-${PKG_VSN}.tar.gz | sed 's/Loaded image: //g')
|
||||||
echo "EMQX_IMAGE_TAG=$EMQX_IMAGE_TAG" >> $GITHUB_ENV
|
echo "EMQX_IMAGE_TAG=$EMQX_IMAGE_TAG" >> $GITHUB_ENV
|
||||||
- name: test two nodes cluster with proto_dist=inet_tls in docker
|
- name: test two nodes cluster with proto_dist=inet_tls in docker
|
||||||
run: |
|
run: |
|
||||||
|
@ -56,10 +58,17 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
docker compose up --abort-on-container-exit --exit-code-from selenium
|
docker compose up --abort-on-container-exit --exit-code-from selenium
|
||||||
|
- name: cleanup
|
||||||
|
if: always()
|
||||||
|
working-directory: ./scripts/ui-tests
|
||||||
|
run: |
|
||||||
|
docker compose rm -fs
|
||||||
|
|
||||||
pytest:
|
pytest:
|
||||||
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }}
|
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }}
|
||||||
env:
|
env:
|
||||||
|
EMQX_NAME: ${{ matrix.profile[0] }}
|
||||||
|
PKG_VSN: ${{ matrix.profile[0] == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }}
|
||||||
DB_BACKEND: ${{ matrix.cluster_db_backend }}
|
DB_BACKEND: ${{ matrix.cluster_db_backend }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -80,10 +89,8 @@ jobs:
|
||||||
name: ${{ matrix.profile }}-docker
|
name: ${{ matrix.profile }}-docker
|
||||||
path: /tmp
|
path: /tmp
|
||||||
- name: load docker image
|
- name: load docker image
|
||||||
env:
|
|
||||||
PKG_VSN: ${{ inputs.version-emqx }}
|
|
||||||
run: |
|
run: |
|
||||||
EMQX_IMAGE_TAG=$(docker load < /tmp/emqx-docker-${PKG_VSN}.tar.gz | sed 's/Loaded image: //g')
|
EMQX_IMAGE_TAG=$(docker load < /tmp/${EMQX_NAME}-${PKG_VSN}.tar.gz | sed 's/Loaded image: //g')
|
||||||
echo "EMQX_IMAGE_TAG=$EMQX_IMAGE_TAG" >> $GITHUB_ENV
|
echo "EMQX_IMAGE_TAG=$EMQX_IMAGE_TAG" >> $GITHUB_ENV
|
||||||
- name: run emqx
|
- name: run emqx
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
@ -105,4 +112,5 @@ jobs:
|
||||||
# simple smoke test for node_dump
|
# simple smoke test for node_dump
|
||||||
- name: test node_dump
|
- name: test node_dump
|
||||||
run: |
|
run: |
|
||||||
|
docker exec -u root node1.emqx.io apt update && apt install -y net-tools
|
||||||
docker exec node1.emqx.io node_dump
|
docker exec node1.emqx.io node_dump
|
||||||
|
|
|
@ -22,7 +22,10 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
helm_test:
|
helm_test:
|
||||||
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }}
|
runs-on: ubuntu-22.04
|
||||||
|
env:
|
||||||
|
EMQX_NAME: ${{ matrix.profile }}
|
||||||
|
PKG_VSN: ${{ matrix.profile == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
@ -35,7 +38,6 @@ jobs:
|
||||||
- emqx-enterprise
|
- emqx-enterprise
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: AutoModality/action-clean@v1
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
path: source
|
path: source
|
||||||
|
@ -44,12 +46,10 @@ jobs:
|
||||||
name: "${{ matrix.profile }}-docker"
|
name: "${{ matrix.profile }}-docker"
|
||||||
path: /tmp
|
path: /tmp
|
||||||
- name: load docker image
|
- name: load docker image
|
||||||
env:
|
|
||||||
PKG_VSN: ${{ inputs.version-emqx }}
|
|
||||||
run: |
|
run: |
|
||||||
EMQX_TAG=$(docker load < /tmp/emqx-docker-${PKG_VSN}.tar.gz | sed 's/Loaded image: //g')
|
EMQX_TAG=$(docker load < /tmp/${EMQX_NAME}-${PKG_VSN}.tar.gz | sed 's/Loaded image: //g')
|
||||||
echo "EMQX_TAG=$EMQX_TAG" >> $GITHUB_ENV
|
echo "EMQX_TAG=$EMQX_TAG" >> $GITHUB_ENV
|
||||||
echo "TARGET=emqx/${{ matrix.profile }}" >> $GITHUB_ENV
|
echo "TARGET=emqx/${EMQX_NAME}" >> $GITHUB_ENV
|
||||||
- run: minikube start
|
- run: minikube start
|
||||||
- run: minikube image load $TARGET:$EMQX_TAG
|
- run: minikube image load $TARGET:$EMQX_TAG
|
||||||
- name: run emqx on chart (k8s)
|
- name: run emqx on chart (k8s)
|
||||||
|
|
Loading…
Reference in New Issue