|
|
@@ -14,49 +14,55 @@ on:
|
|
|
pull_request:
|
|
|
|
|
|
jobs:
|
|
|
- prepare:
|
|
|
- runs-on: aws-amd64
|
|
|
- # prepare source with any OTP version, no need for a matrix
|
|
|
- container: "ghcr.io/emqx/emqx-builder/5.0-24:1.13.4-24.3.4.2-1-ubuntu20.04"
|
|
|
+ build-matrix:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
outputs:
|
|
|
- fast_ct_apps: ${{ steps.find_ct_apps.outputs.fast_ct_apps }}
|
|
|
- docker_ct_apps: ${{ steps.find_ct_apps.outputs.docker_ct_apps }}
|
|
|
+ prepare: ${{ steps.matrix.outputs.prepare }}
|
|
|
+ host: ${{ steps.matrix.outputs.host }}
|
|
|
+ docker: ${{ steps.matrix.outputs.docker }}
|
|
|
+ runs-on: ${{ steps.runner.outputs.runs-on }}
|
|
|
steps:
|
|
|
- - uses: AutoModality/action-clean@v1
|
|
|
- - uses: actions/checkout@v3
|
|
|
- with:
|
|
|
- path: source
|
|
|
- - name: Find CT Apps
|
|
|
- working-directory: source
|
|
|
- id: find_ct_apps
|
|
|
- run: |
|
|
|
- fast_ct_apps="$(./scripts/find-apps.sh --ci fast)"
|
|
|
- docker_ct_apps="$(./scripts/find-apps.sh --ci docker)"
|
|
|
- echo "fast: $fast_ct_apps"
|
|
|
- echo "docker: $docker_ct_apps"
|
|
|
- echo "::set-output name=fast_ct_apps::$fast_ct_apps"
|
|
|
- echo "::set-output name=docker_ct_apps::$docker_ct_apps"
|
|
|
- - name: get_all_deps
|
|
|
- working-directory: source
|
|
|
- env:
|
|
|
- PROFILE: emqx
|
|
|
- #DIAGNOSTIC: 1
|
|
|
- run: |
|
|
|
- make ensure-rebar3
|
|
|
- # fetch all deps and compile
|
|
|
- make emqx
|
|
|
- make test-compile
|
|
|
- cd ..
|
|
|
- zip -ryq source.zip source/* source/.[^.]*
|
|
|
- - uses: actions/upload-artifact@v3
|
|
|
- with:
|
|
|
- name: source-emqx
|
|
|
- path: source.zip
|
|
|
+ - uses: actions/checkout@v3
|
|
|
+ - name: Build matrix
|
|
|
+ id: matrix
|
|
|
+ run: |
|
|
|
+ APPS="$(./scripts/find-apps.sh --ci)"
|
|
|
+ MATRIX="$(echo "${APPS}" | jq -c '
|
|
|
+ [
|
|
|
+ (.[] | select(.profile == "emqx") | . + {
|
|
|
+ builder: "5.0-26",
|
|
|
+ otp: "25.1.2-2",
|
|
|
+ elixir: "1.13.4"
|
|
|
+ }),
|
|
|
+ (.[] | select(.profile == "emqx-enterprise") | . + {
|
|
|
+ builder: "5.0-26",
|
|
|
+ otp: ["24.3.4.2-1", "25.1.2-2"][],
|
|
|
+ elixir: "1.13.4"
|
|
|
+ })
|
|
|
+ ]
|
|
|
+ ')"
|
|
|
+ echo "${MATRIX}" | jq
|
|
|
+ MATRIX_PREPARE="$(echo "${MATRIX}" | jq -c 'map({profile, builder, otp, elixir}) | unique')"
|
|
|
+ MATRIX_HOST="$(echo "${MATRIX}" | jq -c 'map(select(.runner == "host"))')"
|
|
|
+ MATRIX_DOCKER="$(echo "${MATRIX}" | jq -c 'map(select(.runner == "docker"))')"
|
|
|
+ echo "prepare=${MATRIX_PREPARE}" | tee -a $GITHUB_OUTPUT
|
|
|
+ echo "host=${MATRIX_HOST}" | tee -a $GITHUB_OUTPUT
|
|
|
+ echo "docker=${MATRIX_DOCKER}" | tee -a $GITHUB_OUTPUT
|
|
|
+ - name: Choose runner host
|
|
|
+ id: runner
|
|
|
+ run: |
|
|
|
+ RUNS_ON="ubuntu-20.04"
|
|
|
+ ${{ github.repository_owner == 'emqx' }} && RUNS_ON="aws-amd64"
|
|
|
+ echo "runs-on=${RUNS_ON}" | tee -a $GITHUB_OUTPUT
|
|
|
|
|
|
- prepare_ee:
|
|
|
+ prepare:
|
|
|
runs-on: aws-amd64
|
|
|
- # prepare source with any OTP version, no need for a matrix
|
|
|
- container: "ghcr.io/emqx/emqx-builder/5.0-18:1.13.4-24.3.4.2-1-ubuntu20.04"
|
|
|
+ needs: [build-matrix]
|
|
|
+ strategy:
|
|
|
+ fail-fast: false
|
|
|
+ matrix:
|
|
|
+ include: ${{ fromJson(needs.build-matrix.outputs.prepare) }}
|
|
|
+ container: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-ubuntu20.04"
|
|
|
steps:
|
|
|
- uses: AutoModality/action-clean@v1
|
|
|
- uses: actions/checkout@v3
|
|
|
@@ -65,61 +71,48 @@ jobs:
|
|
|
- name: get_all_deps
|
|
|
working-directory: source
|
|
|
env:
|
|
|
- PROFILE: emqx-enterprise
|
|
|
+ PROFILE: ${{ matrix.profile }}
|
|
|
#DIAGNOSTIC: 1
|
|
|
run: |
|
|
|
make ensure-rebar3
|
|
|
# fetch all deps and compile
|
|
|
- make emqx-enterprise
|
|
|
+ make ${{ matrix.profile }}
|
|
|
make test-compile
|
|
|
cd ..
|
|
|
zip -ryq source.zip source/* source/.[^.]*
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
with:
|
|
|
- name: source-emqx-enterprise
|
|
|
+ name: source-${{ matrix.profile }}-${{ matrix.otp }}
|
|
|
path: source.zip
|
|
|
|
|
|
eunit_and_proper:
|
|
|
needs:
|
|
|
+ - build-matrix
|
|
|
- prepare
|
|
|
- - prepare_ee
|
|
|
- runs-on: ${{ matrix.runs-on }}
|
|
|
+ runs-on: ${{ needs.build-matrix.outputs.runs-on }}
|
|
|
strategy:
|
|
|
fail-fast: false
|
|
|
matrix:
|
|
|
- profile:
|
|
|
- - emqx
|
|
|
- - emqx-enterprise
|
|
|
- runs-on:
|
|
|
- - aws-amd64
|
|
|
- - ubuntu-20.04
|
|
|
- use-self-hosted:
|
|
|
- - ${{ github.repository_owner == 'emqx' }}
|
|
|
- exclude:
|
|
|
- - runs-on: ubuntu-20.04
|
|
|
- use-self-hosted: true
|
|
|
- - runs-on: aws-amd64
|
|
|
- use-self-hosted: false
|
|
|
+ include: ${{ fromJson(needs.build-matrix.outputs.prepare) }}
|
|
|
|
|
|
defaults:
|
|
|
run:
|
|
|
shell: bash
|
|
|
- container: "ghcr.io/emqx/emqx-builder/5.0-24:1.13.4-24.3.4.2-1-ubuntu20.04"
|
|
|
+ container: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-ubuntu20.04"
|
|
|
|
|
|
steps:
|
|
|
- uses: AutoModality/action-clean@v1
|
|
|
- uses: actions/download-artifact@v3
|
|
|
with:
|
|
|
- name: source-${{ matrix.profile }}
|
|
|
+ name: source-${{ matrix.profile }}-${{ matrix.otp }}
|
|
|
path: .
|
|
|
- name: unzip source code
|
|
|
- env:
|
|
|
- PROFILE: ${{ matrix.profile }}
|
|
|
run: unzip -o -q source.zip
|
|
|
# produces eunit.coverdata
|
|
|
- name: eunit
|
|
|
env:
|
|
|
PROFILE: ${{ matrix.profile }}
|
|
|
+ CT_COVER_EXPORT_PREFIX: ${{ matrix.profile }}-${{ matrix.otp }}
|
|
|
working-directory: source
|
|
|
run: make eunit
|
|
|
|
|
|
@@ -127,6 +120,7 @@ jobs:
|
|
|
- name: proper
|
|
|
env:
|
|
|
PROFILE: ${{ matrix.profile }}
|
|
|
+ CT_COVER_EXPORT_PREFIX: ${{ matrix.profile }}-${{ matrix.otp }}
|
|
|
working-directory: source
|
|
|
run: make proper
|
|
|
|
|
|
@@ -137,23 +131,14 @@ jobs:
|
|
|
|
|
|
ct_docker:
|
|
|
needs:
|
|
|
+ - build-matrix
|
|
|
- prepare
|
|
|
- - prepare_ee
|
|
|
+ runs-on: ${{ needs.build-matrix.outputs.runs-on }}
|
|
|
strategy:
|
|
|
fail-fast: false
|
|
|
matrix:
|
|
|
- app: ${{ fromJson(needs.prepare.outputs.docker_ct_apps) }}
|
|
|
- runs-on:
|
|
|
- - aws-amd64
|
|
|
- - ubuntu-20.04
|
|
|
- use-self-hosted:
|
|
|
- - ${{ github.repository_owner == 'emqx' }}
|
|
|
- exclude:
|
|
|
- - runs-on: ubuntu-20.04
|
|
|
- use-self-hosted: true
|
|
|
- - runs-on: aws-amd64
|
|
|
- use-self-hosted: false
|
|
|
- runs-on: ${{ matrix.runs-on }}
|
|
|
+ include: ${{ fromJson(needs.build-matrix.outputs.docker) }}
|
|
|
+
|
|
|
defaults:
|
|
|
run:
|
|
|
shell: bash
|
|
|
@@ -162,24 +147,22 @@ jobs:
|
|
|
- uses: AutoModality/action-clean@v1
|
|
|
- uses: actions/download-artifact@v3
|
|
|
with:
|
|
|
- name: source-${{ matrix.app[1] }}
|
|
|
+ name: source-${{ matrix.profile }}-${{ matrix.otp }}
|
|
|
path: .
|
|
|
- name: unzip source code
|
|
|
run: unzip -q source.zip
|
|
|
- name: run tests
|
|
|
working-directory: source
|
|
|
env:
|
|
|
+ DOCKER_CT_RUNNER_IMAGE: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-ubuntu20.04"
|
|
|
MONGO_TAG: 5
|
|
|
MYSQL_TAG: 8
|
|
|
PGSQL_TAG: 13
|
|
|
REDIS_TAG: 6
|
|
|
INFLUXDB_TAG: 2.5.0
|
|
|
- WHICH_APP: ${{ matrix.app[0] }}
|
|
|
- PROFILE: ${{ matrix.app[1] }}
|
|
|
- run: |
|
|
|
- echo $PROFILE
|
|
|
- rm _build/default/lib/rocksdb/_build/cmake/CMakeCache.txt
|
|
|
- ./scripts/ct/run.sh --app $WHICH_APP
|
|
|
+ PROFILE: ${{ matrix.profile }}
|
|
|
+ CT_COVER_EXPORT_PREFIX: ${{ matrix.profile }}-${{ matrix.otp }}
|
|
|
+ run: ./scripts/ct/run.sh --app ${{ matrix.app }}
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
with:
|
|
|
name: coverdata
|
|
|
@@ -187,30 +170,20 @@ jobs:
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
if: failure()
|
|
|
with:
|
|
|
- name: logs-${{ matrix.app[1] }}-${{ matrix.app[2] }}
|
|
|
+ name: logs-${{ matrix.profile }}-${{ matrix.prefix }}
|
|
|
path: source/_build/test/logs
|
|
|
|
|
|
ct:
|
|
|
needs:
|
|
|
+ - build-matrix
|
|
|
- prepare
|
|
|
- - prepare_ee
|
|
|
+ runs-on: ${{ needs.build-matrix.outputs.runs-on }}
|
|
|
strategy:
|
|
|
fail-fast: false
|
|
|
matrix:
|
|
|
- app: ${{ fromJson(needs.prepare.outputs.fast_ct_apps) }}
|
|
|
- runs-on:
|
|
|
- - aws-amd64
|
|
|
- - ubuntu-20.04
|
|
|
- use-self-hosted:
|
|
|
- - ${{ github.repository_owner == 'emqx' }}
|
|
|
- exclude:
|
|
|
- - runs-on: ubuntu-20.04
|
|
|
- use-self-hosted: true
|
|
|
- - runs-on: aws-amd64
|
|
|
- use-self-hosted: false
|
|
|
+ include: ${{ fromJson(needs.build-matrix.outputs.host) }}
|
|
|
|
|
|
- runs-on: ${{ matrix.runs-on }}
|
|
|
- container: "ghcr.io/emqx/emqx-builder/5.0-24:1.13.4-24.3.4.2-1-ubuntu20.04"
|
|
|
+ container: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-ubuntu20.04"
|
|
|
defaults:
|
|
|
run:
|
|
|
shell: bash
|
|
|
@@ -219,7 +192,7 @@ jobs:
|
|
|
- uses: AutoModality/action-clean@v1
|
|
|
- uses: actions/download-artifact@v3
|
|
|
with:
|
|
|
- name: source-${{ matrix.app[1] }}
|
|
|
+ name: source-${{ matrix.profile }}-${{ matrix.otp }}
|
|
|
path: .
|
|
|
- name: unzip source code
|
|
|
run: unzip -q source.zip
|
|
|
@@ -228,10 +201,10 @@ jobs:
|
|
|
- name: run common test
|
|
|
working-directory: source
|
|
|
env:
|
|
|
- WHICH_APP: ${{ matrix.app[0] }}
|
|
|
- PROFILE: ${{ matrix.app[1] }}
|
|
|
+ PROFILE: ${{ matrix.profile }}
|
|
|
+ CT_COVER_EXPORT_PREFIX: ${{ matrix.profile }}-${{ matrix.otp }}
|
|
|
run: |
|
|
|
- make "${WHICH_APP}-ct"
|
|
|
+ make "${{ matrix.app }}-ct"
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
with:
|
|
|
name: coverdata
|
|
|
@@ -240,7 +213,7 @@ jobs:
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
if: failure()
|
|
|
with:
|
|
|
- name: logs-${{ matrix.app[1] }}-${{ matrix.app[2] }}
|
|
|
+ name: logs-${{ matrix.profile }}-${{ matrix.prefix }}
|
|
|
path: source/_build/test/logs
|
|
|
|
|
|
make_cover:
|
|
|
@@ -249,12 +222,12 @@ jobs:
|
|
|
- ct
|
|
|
- ct_docker
|
|
|
runs-on: ubuntu-20.04
|
|
|
- container: "ghcr.io/emqx/emqx-builder/5.0-24:1.13.4-24.3.4.2-1-ubuntu20.04"
|
|
|
+ container: "ghcr.io/emqx/emqx-builder/5.0-26:1.13.4-24.3.4.2-1-ubuntu20.04"
|
|
|
steps:
|
|
|
- uses: AutoModality/action-clean@v1
|
|
|
- uses: actions/download-artifact@v3
|
|
|
with:
|
|
|
- name: source-emqx-enterprise
|
|
|
+ name: source-emqx-enterprise-24.3.4.2-1
|
|
|
path: .
|
|
|
- name: unzip source code
|
|
|
run: unzip -q source.zip
|