| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406 |
- name: Compatibility Test Suite
- on:
- schedule:
- - cron: '0 */6 * * *'
- pull_request:
- push:
- tags:
- - v*
- - e*
- jobs:
- ldap:
- runs-on: ubuntu-20.04
- strategy:
- fail-fast: false
- matrix:
- ldap_tag:
- - 2.4.50
- network_type:
- - ipv4
- - ipv6
- steps:
- - uses: actions/checkout@v1
- - name: docker compose up
- env:
- LDAP_TAG: ${{ matrix.ldap_tag }}
- run: |
- docker-compose \
- -f .ci/docker-compose-file/docker-compose-ldap-tcp.yaml \
- -f .ci/docker-compose-file/docker-compose.yaml \
- up -d --build
- - name: setup
- if: matrix.network_type == 'ipv4'
- run: |
- echo EMQX_AUTH__LDAP__SERVERS=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ldap) >> "$GITHUB_ENV"
- - name: setup
- if: matrix.network_type == 'ipv6'
- run: |
- echo EMQX_AUTH__LDAP__SERVERS=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.GlobalIPv6Address}}{{end}}' ldap) >> "$GITHUB_ENV"
- - name: set git token
- run: |
- if make emqx-ee --dry-run > /dev/null 2>&1; then
- docker exec -i erlang bash -c "echo \"https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com\" > /root/.git-credentials && git config --global credential.helper store"
- fi
- - name: run test cases
- run: |
- docker exec -i erlang sh -c "make ensure-rebar3"
- printenv | grep "^EMQX_" > .env
- docker exec -i \
- -e "CUTTLEFISH_ENV_OVERRIDE_PREFIX=EMQX_" \
- --env-file .env \
- erlang sh -c "make apps/emqx_auth_ldap-ct"
- - uses: actions/upload-artifact@v1
- if: failure()
- with:
- name: logs_ldap${{ matrix.ldap_tag }}_${{ matrix.network_type }}
- path: _build/test/logs
- mongo:
- runs-on: ubuntu-20.04
- strategy:
- fail-fast: false
- matrix:
- mongo_tag:
- - 3
- - 4
- network_type:
- - ipv4
- - ipv6
- connect_type:
- - tls
- - tcp
- steps:
- - uses: actions/checkout@v1
- - name: docker-compose up
- run: |
- docker-compose \
- -f .ci/docker-compose-file/docker-compose-mongo-${{ matrix.connect_type }}.yaml \
- -f .ci/docker-compose-file/docker-compose.yaml \
- up -d --build
- - name: setup
- env:
- MONGO_TAG: ${{ matrix.mongo_tag }}
- if: matrix.connect_type == 'tls'
- run: |
- cat <<-EOF >> "$GITHUB_ENV"
- EMQX_AUTH__MONGO__SSL=on
- EMQX_AUTH__MONGO__SSL__CACERTFILE=/emqx/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/ca.pem
- EMQX_AUTH__MONGO__SSL__CERTFILE=/emqx/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/client-cert.pem
- EMQX_AUTH__MONGO__SSL__KEYFILE=/emqx/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE_data/client-key.pem
- EMQX_AUTH__MONGO__SSL__VERIFY=true
- EMQX_AUTH__MONGO__SSL__SERVER_NAME_INDICATION=disable
- EOF
- - name: setup
- env:
- MONGO_TAG: ${{ matrix.mongo_tag }}
- if: matrix.connect_type == 'tcp'
- run: |
- echo EMQX_AUTH__MONGO__SSL=off >> "$GITHUB_ENV"
- - name: setup
- if: matrix.network_type == 'ipv4'
- run: |
- echo "EMQX_AUTH__MONGO__SERVER=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mongo):27017" >> "$GITHUB_ENV"
- - name: setup
- if: matrix.network_type == 'ipv6'
- run: |
- echo "EMQX_AUTH__MONGO__SERVER=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.GlobalIPv6Address}}{{end}}' mongo):27017" >> "$GITHUB_ENV"
- - name: set git token
- run: |
- if make emqx-ee --dry-run > /dev/null 2>&1; then
- docker exec -i erlang bash -c "echo \"https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com\" > /root/.git-credentials && git config --global credential.helper store"
- fi
- - name: run test cases
- run: |
- printenv | grep "^EMQX_" > .env
- docker exec -i \
- -e "CUTTLEFISH_ENV_OVERRIDE_PREFIX=EMQX_" \
- --env-file .env \
- erlang sh -c "make apps/emqx_auth_mongo-ct"
- - uses: actions/upload-artifact@v1
- if: failure()
- with:
- name: logs_mongo${{ matrix.mongo_tag }}_${{ matrix.network_type }}_${{ matrix.connect_type }}
- path: _build/test/logs
- mysql:
- runs-on: ubuntu-20.04
- strategy:
- fail-fast: false
- matrix:
- mysql_tag:
- - 5.7
- - 8
- network_type:
- - ipv4
- - ipv6
- connect_type:
- - tls
- - tcp
- steps:
- - uses: actions/checkout@v1
- - name: docker-compose up
- timeout-minutes: 5
- run: |
- docker-compose \
- -f .ci/docker-compose-file/docker-compose-mysql-${{ matrix.connect_type }}.yaml \
- -f .ci/docker-compose-file/docker-compose.yaml \
- up -d --build
- while [ $(docker ps -a --filter name=client --filter exited=0 | wc -l) \
- != $(docker ps -a --filter name=client | wc -l) ]; do
- sleep 5
- done
- - name: setup
- env:
- MYSQL_TAG: ${{ matrix.mysql_tag }}
- if: matrix.connect_type == 'tls'
- run: |
- cat <<-EOF >> "$GITHUB_ENV"
- EMQX_AUTH__MYSQL__USERNAME=ssluser
- EMQX_AUTH__MYSQL__PASSWORD=public
- EMQX_AUTH__MYSQL__DATABASE=mqtt
- EMQX_AUTH__MYSQL__SSL=on
- EMQX_AUTH__MYSQL__SSL__CACERTFILE=/emqx/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/ca.pem
- EMQX_AUTH__MYSQL__SSL__CERTFILE=/emqx/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/client-cert.pem
- EMQX_AUTH__MYSQL__SSL__KEYFILE=/emqx/apps/emqx_auth_mysql/test/emqx_auth_mysql_SUITE_data/client-key.pem
- EMQX_AUTH__MYSQL__SSL__VERIFY=true
- EMQX_AUTH__MYSQL__SSL__SERVER_NAME_INDICATION=disable
- EOF
- - name: setup
- env:
- MYSQL_TAG: ${{ matrix.mysql_tag }}
- if: matrix.connect_type == 'tcp'
- run: |
- cat <<-EOF >> "$GITHUB_ENV"
- EMQX_AUTH__MYSQL__USERNAME=root
- EMQX_AUTH__MYSQL__PASSWORD=public
- EMQX_AUTH__MYSQL__DATABASE=mqtt
- EMQX_AUTH__MYSQL__SSL=off
- EOF
- - name: setup
- if: matrix.network_type == 'ipv4'
- run: |
- echo "EMQX_AUTH__MYSQL__SERVER=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mysql):3306" >> "$GITHUB_ENV"
- - name: setup
- if: matrix.network_type == 'ipv6'
- run: |
- echo "EMQX_AUTH__MYSQL__SERVER=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.GlobalIPv6Address}}{{end}}' mysql):3306" >> "$GITHUB_ENV"
- - name: set git token
- run: |
- if make emqx-ee --dry-run > /dev/null 2>&1; then
- docker exec -i erlang bash -c "echo \"https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com\" > /root/.git-credentials && git config --global credential.helper store"
- fi
- - name: run test cases
- run: |
- printenv | grep "^EMQX_" > .env
- docker exec -i \
- -e "CUTTLEFISH_ENV_OVERRIDE_PREFIX=EMQX_" \
- --env-file .env \
- erlang sh -c "make apps/emqx_auth_mysql-ct"
- - uses: actions/upload-artifact@v1
- if: failure()
- with:
- name: logs_mysql${{ matrix.mysql_tag }}_${{ matrix.network_type }}_${{ matrix.connect_type }}
- path: _build/test/logs
- pgsql:
- runs-on: ubuntu-20.04
- strategy:
- fail-fast: false
- matrix:
- pgsql_tag:
- - 9
- - 10
- - 11
- - 12
- - 13
- network_type:
- - ipv4
- - ipv6
- connect_type:
- - tls
- - tcp
- steps:
- - uses: actions/checkout@v1
- - name: docker-compose up
- run: |
- docker-compose \
- -f .ci/docker-compose-file/docker-compose-pgsql-${{ matrix.connect_type }}.yaml \
- -f .ci/docker-compose-file/docker-compose.yaml \
- up -d --build
- - name: setup
- env:
- PGSQL_TAG: ${{ matrix.pgsql_tag }}
- if: matrix.connect_type == 'tls'
- run: |
- cat <<-EOF >> "$GITHUB_ENV"
- EMQX_AUTH__PGSQL__SSL=on
- EMQX_AUTH__PGSQL__SSL__CACERTFILE=/emqx/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/ca.pem
- EMQX_AUTH__PGSQL__SSL__CERTFILE=/emqx/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/client-cert.pem
- EMQX_AUTH__PGSQL__SSL__KEYFILE=/emqx/apps/emqx_auth_pgsql/test/emqx_auth_pgsql_SUITE_data/client-key.pem
- EMQX_AUTH__PGSQL__SSL__VERIFY=true
- EMQX_AUTH__PGSQL__SSL__SERVER_NAME_INDICATION=disable
- EOF
- - name: setup
- env:
- PGSQL_TAG: ${{ matrix.pgsql_tag }}
- if: matrix.connect_type == 'tcp'
- run: |
- echo EMQX_AUTH__PGSQL__SSL=off >> "$GITHUB_ENV"
- - name: setup
- if: matrix.network_type == 'ipv4'
- run: |
- echo "EMQX_AUTH__PGSQL__SERVER=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pgsql):5432" >> "$GITHUB_ENV"
- - name: setup
- if: matrix.network_type == 'ipv6'
- run: |
- echo "EMQX_AUTH__PGSQL__SERVER=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.GlobalIPv6Address}}{{end}}' pgsql):5432" >> "$GITHUB_ENV"
- - name: set git token
- run: |
- if make emqx-ee --dry-run > /dev/null 2>&1; then
- docker exec -i erlang bash -c "echo \"https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com\" > /root/.git-credentials && git config --global credential.helper store"
- fi
- - name: run test cases
- run: |
- export EMQX_AUTH__PGSQL__USERNAME=root \
- EMQX_AUTH__PGSQL__PASSWORD=public \
- EMQX_AUTH__PGSQL__DATABASE=mqtt
- printenv | grep "^EMQX_" > .env
- docker exec -i \
- -e "CUTTLEFISH_ENV_OVERRIDE_PREFIX=EMQX_" \
- --env-file .env \
- erlang sh -c "make apps/emqx_auth_pgsql-ct"
- - uses: actions/upload-artifact@v1
- if: failure()
- with:
- name: logs_pgsql${{ matrix.pgsql_tag }}_${{ matrix.network_type }}_${{ matrix.connect_type }}
- path: _build/test/logs
- redis:
- runs-on: ubuntu-20.04
- strategy:
- fail-fast: false
- matrix:
- redis_tag:
- - 5
- - 6
- network_type:
- - ipv4
- - ipv6
- connect_type:
- - tls
- - tcp
- node_type:
- - single
- - sentinel
- - cluster
- exclude:
- - redis_tag: 5
- connect_type: tls
- steps:
- - uses: actions/checkout@v1
- - name: docker-compose up
- run: |
- docker-compose \
- -f .ci/docker-compose-file/docker-compose-redis-${{ matrix.node_type }}-${{ matrix.connect_type }}.yaml \
- -f .ci/docker-compose-file/docker-compose.yaml \
- up -d --build
- - name: setup
- env:
- REDIS_TAG: ${{ matrix.redis_tag }}
- if: matrix.connect_type == 'tls'
- run: |
- cat <<-EOF >> "$GITHUB_ENV"
- EMQX_AUTH__REDIS__SSL=on
- EMQX_AUTH__REDIS__SSL__CACERTFILE=/emqx/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/ca.crt
- EMQX_AUTH__REDIS__SSL__CERTFILE=/emqx/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/redis.crt
- EMQX_AUTH__REDIS__SSL__KEYFILE=/emqx/apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs/redis.key
- EMQX_AUTH__REDIS__SSL__VERIFY=true
- EMQX_AUTH__REDIS__SSL__SERVER_NAME_INDICATION=disable
- EOF
- - name: setup
- env:
- REDIS_TAG: ${{ matrix.redis_tag }}
- if: matrix.connect_type == 'tcp'
- run: |
- echo EMQX_AUTH__REDIS__SSL=off >> "$GITHUB_ENV"
- - name: get server address
- run: |
- ipv4_address=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' redis)
- ipv6_address=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.GlobalIPv6Address}}{{end}}' redis)
- cat <<-EOF >> "$GITHUB_ENV"
- redis_ipv4_address=$ipv4_address
- redis_ipv6_address=$ipv6_address
- EOF
- - name: setup
- if: matrix.node_type == 'single' && matrix.connect_type == 'tcp'
- run: |
- cat <<-EOF >> "$GITHUB_ENV"
- EMQX_AUTH__REDIS__TYPE=single
- EMQX_AUTH__REDIS__SERVER=${redis_${{ matrix.network_type }}_address}:6379
- EOF
- - name: setup
- if: matrix.node_type == 'single' && matrix.connect_type == 'tls'
- run: |
- cat <<-EOF >> "$GITHUB_ENV"
- EMQX_AUTH__REDIS__TYPE=single
- EMQX_AUTH__REDIS__SERVER=${redis_${{ matrix.network_type }}_address}:6380
- EOF
- - name: setup
- if: matrix.node_type == 'sentinel' && matrix.connect_type == 'tcp'
- run: |
- cat <<-EOF >> "$GITHUB_ENV"
- EMQX_AUTH__REDIS__TYPE=sentinel
- EMQX_AUTH__REDIS__SERVER=${redis_${{ matrix.network_type }}_address}:26379
- EMQX_AUTH__REDIS__SENTINEL=mymaster
- EOF
- - name: setup
- if: matrix.node_type == 'sentinel' && matrix.connect_type == 'tls'
- run: |
- cat <<-EOF >> "$GITHUB_ENV"
- EMQX_AUTH__REDIS__TYPE=sentinel
- EMQX_AUTH__REDIS__SERVER=${redis_${{ matrix.network_type }}_address}:26380
- EMQX_AUTH__REDIS__SENTINEL=mymaster
- EOF
- - name: setup
- if: matrix.node_type == 'cluster' && matrix.connect_type == 'tcp'
- run: |
- cat <<-EOF >> "$GITHUB_ENV"
- EMQX_AUTH__REDIS__TYPE=cluster
- EMQX_AUTH__REDIS__SERVER=${redis_${{ matrix.network_type }}_address}:7000
- EOF
- - name: setup
- if: matrix.node_type == 'cluster' && matrix.connect_type == 'tls'
- run: |
- cat <<-EOF >> "$GITHUB_ENV"
- EMQX_AUTH__REDIS__TYPE=cluster
- EMQX_AUTH__REDIS__SERVER=${redis_${{ matrix.network_type }}_address}:8000
- EOF
- - name: set git token
- run: |
- if make emqx-ee --dry-run > /dev/null 2>&1; then
- docker exec -i erlang bash -c "echo \"https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com\" > /root/.git-credentials && git config --global credential.helper store"
- fi
- - name: run test cases
- run: |
- export EMQX_AUTH__REIDS__PASSWORD=public
- printenv | grep "^EMQX_" > .env
- docker exec -i \
- -e "CUTTLEFISH_ENV_OVERRIDE_PREFIX=EMQX_" \
- --env-file .env \
- erlang sh -c "make apps/emqx_auth_redis-ct"
- - uses: actions/upload-artifact@v1
- if: failure()
- with:
- name: logs_redis${{ matrix.redis_tag }}_${{ matrix.node_type }}_${{ matrix.network_type }}_${{ matrix.connect_type }}
- path: _build/test/logs
|