chore(CI): app test workflows support enterprose repo

This commit is contained in:
zhanghongtong 2021-03-19 16:48:08 +08:00 committed by tigercl
parent 8201e4c820
commit be4faa6d7c
4 changed files with 49 additions and 7 deletions

View File

@ -1,4 +1,4 @@
version: '3' version: '3.9'
services: services:
erlang: erlang:
@ -26,6 +26,11 @@ services:
- ../../.:/emqx - ../../.:/emqx
working_dir: /emqx working_dir: /emqx
tty: true tty: true
deploy:
resources:
reservations:
cpus: '0.5'
memory: 500M
mysql_server: mysql_server:
container_name: mysql container_name: mysql

View File

@ -250,13 +250,16 @@ jobs:
node_type: node_type:
- single - single
- cluster - cluster
exclude:
- redis_tag: 5
connect_type: tls
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: setup - name: setup
env: env:
REDIS_TAG: ${{ matrix.redis_tag }} REDIS_TAG: ${{ matrix.redis_tag }}
if: matrix.connect_type == 'tls' && matrix.redis_tag != '5' if: matrix.connect_type == 'tls'
run: | run: |
set -exu set -exu
docker-compose -f .ci/compatibility_tests/docker-compose-redis-${{ matrix.node_type }}-tls.yaml up -d docker-compose -f .ci/compatibility_tests/docker-compose-redis-${{ matrix.node_type }}-tls.yaml up -d
@ -274,7 +277,6 @@ jobs:
docker-compose -f .ci/compatibility_tests/docker-compose-redis-${{ matrix.node_type }}.yaml up -d docker-compose -f .ci/compatibility_tests/docker-compose-redis-${{ matrix.node_type }}.yaml up -d
echo EMQX_AUTH__REDIS__SSL=off >> "$GITHUB_ENV" echo EMQX_AUTH__REDIS__SSL=off >> "$GITHUB_ENV"
- name: get server address - name: get server address
if: matrix.connect_type == 'tcp' || (matrix.connect_type == 'tls' && matrix.redis_tag != '5')
run: | run: |
set -exu set -exu
ipv4_address=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' redis) ipv4_address=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' redis)
@ -292,7 +294,7 @@ jobs:
EMQX_AUTH__REDIS__SERVER=${redis_${{ matrix.network_type }}_address}:6379 EMQX_AUTH__REDIS__SERVER=${redis_${{ matrix.network_type }}_address}:6379
EOF EOF
- name: setup - name: setup
if: matrix.node_type == 'single' && matrix.connect_type == 'tls' && matrix.redis_tag != '5' if: matrix.node_type == 'single' && matrix.connect_type == 'tls'
run: | run: |
set -exu set -exu
cat <<-EOF >> "$GITHUB_ENV" cat <<-EOF >> "$GITHUB_ENV"
@ -308,7 +310,7 @@ jobs:
EMQX_AUTH__REDIS__SERVER=${redis_${{ matrix.network_type }}_address}:7000 EMQX_AUTH__REDIS__SERVER=${redis_${{ matrix.network_type }}_address}:7000
EOF EOF
- name: setup - name: setup
if: matrix.node_type == 'cluster' && matrix.connect_type == 'tls' && matrix.redis_tag != '5' if: matrix.node_type == 'cluster' && matrix.connect_type == 'tls'
run: | run: |
set -exu set -exu
cat <<-EOF >> "$GITHUB_ENV" cat <<-EOF >> "$GITHUB_ENV"
@ -316,7 +318,6 @@ jobs:
EMQX_AUTH__REDIS__SERVER=${redis_${{ matrix.network_type }}_address}:8000 EMQX_AUTH__REDIS__SERVER=${redis_${{ matrix.network_type }}_address}:8000
EOF EOF
- name: run test cases - name: run test cases
if: matrix.connect_type == 'tcp' || (matrix.connect_type == 'tls' && matrix.redis_tag != '5')
run: | run: |
export CUTTLEFISH_ENV_OVERRIDE_PREFIX=EMQX_ export CUTTLEFISH_ENV_OVERRIDE_PREFIX=EMQX_
printenv > .env printenv > .env

View File

@ -16,6 +16,12 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: set git credentials
run: |
if make emqx-ee --dry-run > /dev/null 2>&1; then
echo "https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com" > $HOME/.git-credentials
git config --global credential.helper store
fi
- name: xref - name: xref
run: make xref run: make xref
- name: dialyzer - name: dialyzer
@ -26,7 +32,16 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: set up - name: set edition
id: set_edition
run: |
if make emqx-ee --dry-run > /dev/null 2>&1; then
echo "EDITION=enterprise" >> $GITHUB_ENV
else
echo "EDITION=opensource" >> $GITHUB_ENV
fi
- name: docker compose up
if: env.EDITION == 'opensource'
env: env:
MYSQL_TAG: 8 MYSQL_TAG: 8
REDIS_TAG: 6 REDIS_TAG: 6
@ -37,6 +52,27 @@ jobs:
run: | run: |
docker-compose -f .ci/apps_tests/docker-compose.yaml build --no-cache docker-compose -f .ci/apps_tests/docker-compose.yaml build --no-cache
docker-compose -f .ci/apps_tests/docker-compose.yaml up -d docker-compose -f .ci/apps_tests/docker-compose.yaml up -d
- name: docker compose up
if: env.EDITION == 'enterprise'
env:
MYSQL_TAG: 8
REDIS_TAG: 6
MONGO_TAG: 4
PGSQL_TAG: 13
LDAP_TAG: 2.4.50
OPENTSDB_TAG: latest
INFLUXDB_TAG: 1.7.6
DYNAMODB_TAG: 1.11.477
TIMESCALE_TAG: latest-pg11
CASSANDRA_TAG: 3.11.6
RABBITMQ_TAG: 3.7
KAFKA_TAG: 2.5.0
PULSAR_TAG: 2.3.2
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker-compose -f .ci/apps_tests/docker-compose.yaml -f .ci/apps_tests/docker-compose.enterprise.yaml build --no-cache
docker-compose -f .ci/apps_tests/docker-compose.yaml -f .ci/apps_tests/docker-compose.enterprise.yaml up -d
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"
- name: run eunit - name: run eunit
run: | run: |
docker exec -i erlang bash -c "make eunit" docker exec -i erlang bash -c "make eunit"