Merge pull request #11863 from id/1101-ci-cost-reduction

ci cost reduction
This commit is contained in:
Zaiming (Stone) Shi 2023-11-03 19:09:39 +01:00 committed by GitHub
commit 77723ada01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 56 additions and 109 deletions

View File

@ -16,7 +16,7 @@ env:
jobs: jobs:
sanity-checks: sanity-checks:
runs-on: ${{ fromJSON(github.repository_owner == 'emqx' && '["self-hosted","ephemeral","linux","x64"]' || '["ubuntu-22.04"]') }} runs-on: ubuntu-22.04
container: "ghcr.io/emqx/emqx-builder/5.2-3:1.14.5-25.3.2-2-ubuntu22.04" container: "ghcr.io/emqx/emqx-builder/5.2-3:1.14.5-25.3.2-2-ubuntu22.04"
outputs: outputs:
ct-matrix: ${{ steps.matrix.outputs.ct-matrix }} ct-matrix: ${{ steps.matrix.outputs.ct-matrix }}
@ -24,8 +24,6 @@ jobs:
ct-docker: ${{ steps.matrix.outputs.ct-docker }} ct-docker: ${{ steps.matrix.outputs.ct-docker }}
version-emqx: ${{ steps.matrix.outputs.version-emqx }} version-emqx: ${{ steps.matrix.outputs.version-emqx }}
version-emqx-enterprise: ${{ steps.matrix.outputs.version-emqx-enterprise }} version-emqx-enterprise: ${{ steps.matrix.outputs.version-emqx-enterprise }}
runner_labels: ${{ github.repository_owner == 'emqx' && '["self-hosted","ephemeral","linux","x64"]' || '["ubuntu-22.04"]' }}
xl_runner_labels: ${{ github.repository_owner == 'emqx' && '["self-hosted","ephemeral-xl","linux","x64"]' || '["ubuntu-22.04"]' }}
builder: "ghcr.io/emqx/emqx-builder/5.2-3:1.14.5-25.3.2-2-ubuntu22.04" builder: "ghcr.io/emqx/emqx-builder/5.2-3:1.14.5-25.3.2-2-ubuntu22.04"
builder_vsn: "5.2-3" builder_vsn: "5.2-3"
otp_vsn: "25.3.2-2" otp_vsn: "25.3.2-2"
@ -116,7 +114,7 @@ jobs:
echo "version-emqx-enterprise=$(./pkg-vsn.sh emqx-enterprise)" | tee -a $GITHUB_OUTPUT echo "version-emqx-enterprise=$(./pkg-vsn.sh emqx-enterprise)" | tee -a $GITHUB_OUTPUT
compile: compile:
runs-on: ${{ fromJSON(needs.sanity-checks.outputs.xl_runner_labels) }} runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral-xl","linux","x64"]') }}
container: ${{ needs.sanity-checks.outputs.builder }} container: ${{ needs.sanity-checks.outputs.builder }}
needs: needs:
- sanity-checks - sanity-checks
@ -154,7 +152,6 @@ jobs:
- compile - compile
uses: ./.github/workflows/run_emqx_app_tests.yaml uses: ./.github/workflows/run_emqx_app_tests.yaml
with: with:
runner_labels: ${{ needs.sanity-checks.outputs.xl_runner_labels }}
builder: ${{ needs.sanity-checks.outputs.builder }} builder: ${{ needs.sanity-checks.outputs.builder }}
before_ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }} before_ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
after_ref: ${{ github.sha }} after_ref: ${{ github.sha }}
@ -165,7 +162,6 @@ jobs:
- compile - compile
uses: ./.github/workflows/run_test_cases.yaml uses: ./.github/workflows/run_test_cases.yaml
with: with:
runner_labels: ${{ needs.sanity-checks.outputs.runner_labels }}
builder: ${{ needs.sanity-checks.outputs.builder }} builder: ${{ needs.sanity-checks.outputs.builder }}
ct-matrix: ${{ needs.sanity-checks.outputs.ct-matrix }} ct-matrix: ${{ needs.sanity-checks.outputs.ct-matrix }}
ct-host: ${{ needs.sanity-checks.outputs.ct-host }} ct-host: ${{ needs.sanity-checks.outputs.ct-host }}
@ -177,7 +173,6 @@ jobs:
- compile - compile
uses: ./.github/workflows/static_checks.yaml uses: ./.github/workflows/static_checks.yaml
with: with:
runner_labels: ${{ needs.sanity-checks.outputs.runner_labels }}
builder: ${{ needs.sanity-checks.outputs.builder }} builder: ${{ needs.sanity-checks.outputs.builder }}
ct-matrix: ${{ needs.sanity-checks.outputs.ct-matrix }} ct-matrix: ${{ needs.sanity-checks.outputs.ct-matrix }}
@ -186,7 +181,6 @@ jobs:
- sanity-checks - sanity-checks
uses: ./.github/workflows/build_slim_packages.yaml uses: ./.github/workflows/build_slim_packages.yaml
with: with:
runner_labels: ${{ needs.sanity-checks.outputs.runner_labels }}
builder: ${{ needs.sanity-checks.outputs.builder }} builder: ${{ needs.sanity-checks.outputs.builder }}
builder_vsn: ${{ needs.sanity-checks.outputs.builder_vsn }} builder_vsn: ${{ needs.sanity-checks.outputs.builder_vsn }}
otp_vsn: ${{ needs.sanity-checks.outputs.otp_vsn }} otp_vsn: ${{ needs.sanity-checks.outputs.otp_vsn }}
@ -197,7 +191,6 @@ jobs:
- sanity-checks - sanity-checks
uses: ./.github/workflows/build_docker_for_test.yaml uses: ./.github/workflows/build_docker_for_test.yaml
with: with:
runner_labels: ${{ needs.sanity-checks.outputs.runner_labels }}
otp_vsn: ${{ needs.sanity-checks.outputs.otp_vsn }} otp_vsn: ${{ needs.sanity-checks.outputs.otp_vsn }}
elixir_vsn: ${{ needs.sanity-checks.outputs.elixir_vsn }} elixir_vsn: ${{ needs.sanity-checks.outputs.elixir_vsn }}
version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }} version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }}
@ -208,8 +201,6 @@ jobs:
- sanity-checks - sanity-checks
- build_slim_packages - build_slim_packages
uses: ./.github/workflows/spellcheck.yaml uses: ./.github/workflows/spellcheck.yaml
with:
runner_labels: ${{ needs.sanity-checks.outputs.runner_labels }}
run_conf_tests: run_conf_tests:
needs: needs:
@ -217,7 +208,6 @@ jobs:
- compile - compile
uses: ./.github/workflows/run_conf_tests.yaml uses: ./.github/workflows/run_conf_tests.yaml
with: with:
runner_labels: ${{ needs.sanity-checks.outputs.runner_labels }}
builder: ${{ needs.sanity-checks.outputs.builder }} builder: ${{ needs.sanity-checks.outputs.builder }}
check_deps_integrity: check_deps_integrity:
@ -225,7 +215,6 @@ jobs:
- sanity-checks - sanity-checks
uses: ./.github/workflows/check_deps_integrity.yaml uses: ./.github/workflows/check_deps_integrity.yaml
with: with:
runner_labels: ${{ needs.sanity-checks.outputs.runner_labels }}
builder: ${{ needs.sanity-checks.outputs.builder }} builder: ${{ needs.sanity-checks.outputs.builder }}
run_jmeter_tests: run_jmeter_tests:
@ -234,7 +223,6 @@ jobs:
- build_docker_for_test - build_docker_for_test
uses: ./.github/workflows/run_jmeter_tests.yaml uses: ./.github/workflows/run_jmeter_tests.yaml
with: with:
runner_labels: ${{ needs.sanity-checks.outputs.runner_labels }}
version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }} version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }}
run_docker_tests: run_docker_tests:
@ -243,7 +231,6 @@ jobs:
- build_docker_for_test - build_docker_for_test
uses: ./.github/workflows/run_docker_tests.yaml uses: ./.github/workflows/run_docker_tests.yaml
with: with:
runner_labels: ${{ needs.sanity-checks.outputs.runner_labels }}
version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }} version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }}
version-emqx-enterprise: ${{ needs.sanity-checks.outputs.version-emqx-enterprise }} version-emqx-enterprise: ${{ needs.sanity-checks.outputs.version-emqx-enterprise }}
@ -253,6 +240,5 @@ jobs:
- build_docker_for_test - build_docker_for_test
uses: ./.github/workflows/run_helm_tests.yaml uses: ./.github/workflows/run_helm_tests.yaml
with: with:
runner_labels: ${{ needs.sanity-checks.outputs.runner_labels }}
version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }} version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }}
version-emqx-enterprise: ${{ needs.sanity-checks.outputs.version-emqx-enterprise }} version-emqx-enterprise: ${{ needs.sanity-checks.outputs.version-emqx-enterprise }}

View File

@ -19,7 +19,7 @@ env:
jobs: jobs:
prepare: prepare:
runs-on: ${{ fromJSON(github.repository_owner == 'emqx' && '["self-hosted","ephemeral","linux","x64"]' || '["ubuntu-22.04"]') }} runs-on: ubuntu-22.04
container: 'ghcr.io/emqx/emqx-builder/5.2-3:1.14.5-25.3.2-2-ubuntu22.04' container: 'ghcr.io/emqx/emqx-builder/5.2-3:1.14.5-25.3.2-2-ubuntu22.04'
outputs: outputs:
profile: ${{ steps.parse-git-ref.outputs.profile }} profile: ${{ steps.parse-git-ref.outputs.profile }}
@ -29,7 +29,6 @@ jobs:
ct-matrix: ${{ steps.matrix.outputs.ct-matrix }} ct-matrix: ${{ steps.matrix.outputs.ct-matrix }}
ct-host: ${{ steps.matrix.outputs.ct-host }} ct-host: ${{ steps.matrix.outputs.ct-host }}
ct-docker: ${{ steps.matrix.outputs.ct-docker }} ct-docker: ${{ steps.matrix.outputs.ct-docker }}
runner_labels: ${{ github.repository_owner == 'emqx' && '["self-hosted","ephemeral","linux","x64"]' || '["ubuntu-22.04"]' }}
builder: 'ghcr.io/emqx/emqx-builder/5.2-3:1.14.5-25.3.2-2-ubuntu22.04' builder: 'ghcr.io/emqx/emqx-builder/5.2-3:1.14.5-25.3.2-2-ubuntu22.04'
builder_vsn: '5.2-3' builder_vsn: '5.2-3'
otp_vsn: '25.3.2-2' otp_vsn: '25.3.2-2'
@ -108,7 +107,6 @@ jobs:
otp_vsn: ${{ needs.prepare.outputs.otp_vsn }} otp_vsn: ${{ needs.prepare.outputs.otp_vsn }}
elixir_vsn: ${{ needs.prepare.outputs.elixir_vsn }} elixir_vsn: ${{ needs.prepare.outputs.elixir_vsn }}
builder_vsn: ${{ needs.prepare.outputs.builder_vsn }} builder_vsn: ${{ needs.prepare.outputs.builder_vsn }}
runner_labels: ${{ needs.prepare.outputs.runner_labels }}
secrets: inherit secrets: inherit
build_slim_packages: build_slim_packages:
@ -117,7 +115,6 @@ jobs:
- prepare - prepare
uses: ./.github/workflows/build_slim_packages.yaml uses: ./.github/workflows/build_slim_packages.yaml
with: with:
runner_labels: ${{ needs.prepare.outputs.runner_labels }}
builder: ${{ needs.prepare.outputs.builder }} builder: ${{ needs.prepare.outputs.builder }}
builder_vsn: ${{ needs.prepare.outputs.builder_vsn }} builder_vsn: ${{ needs.prepare.outputs.builder_vsn }}
otp_vsn: ${{ needs.prepare.outputs.otp_vsn }} otp_vsn: ${{ needs.prepare.outputs.otp_vsn }}
@ -125,7 +122,7 @@ jobs:
compile: compile:
if: needs.prepare.outputs.release != 'true' if: needs.prepare.outputs.release != 'true'
runs-on: ${{ fromJSON(needs.prepare.outputs.runner_labels) }} runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
container: ${{ needs.prepare.outputs.builder }} container: ${{ needs.prepare.outputs.builder }}
needs: needs:
- prepare - prepare
@ -162,7 +159,6 @@ jobs:
- compile - compile
uses: ./.github/workflows/run_emqx_app_tests.yaml uses: ./.github/workflows/run_emqx_app_tests.yaml
with: with:
runner_labels: ${{ needs.prepare.outputs.runner_labels }}
builder: ${{ needs.prepare.outputs.builder }} builder: ${{ needs.prepare.outputs.builder }}
before_ref: ${{ github.event.before }} before_ref: ${{ github.event.before }}
after_ref: ${{ github.sha }} after_ref: ${{ github.sha }}
@ -174,7 +170,6 @@ jobs:
- compile - compile
uses: ./.github/workflows/run_test_cases.yaml uses: ./.github/workflows/run_test_cases.yaml
with: with:
runner_labels: ${{ needs.prepare.outputs.runner_labels }}
builder: ${{ needs.prepare.outputs.builder }} builder: ${{ needs.prepare.outputs.builder }}
ct-matrix: ${{ needs.prepare.outputs.ct-matrix }} ct-matrix: ${{ needs.prepare.outputs.ct-matrix }}
ct-host: ${{ needs.prepare.outputs.ct-host }} ct-host: ${{ needs.prepare.outputs.ct-host }}
@ -187,7 +182,6 @@ jobs:
- compile - compile
uses: ./.github/workflows/run_conf_tests.yaml uses: ./.github/workflows/run_conf_tests.yaml
with: with:
runner_labels: ${{ needs.prepare.outputs.runner_labels }}
builder: ${{ needs.prepare.outputs.builder }} builder: ${{ needs.prepare.outputs.builder }}
static_checks: static_checks:
@ -197,6 +191,5 @@ jobs:
- compile - compile
uses: ./.github/workflows/static_checks.yaml uses: ./.github/workflows/static_checks.yaml
with: with:
runner_labels: ${{ needs.prepare.outputs.runner_labels }}
builder: ${{ needs.prepare.outputs.builder }} builder: ${{ needs.prepare.outputs.builder }}
ct-matrix: ${{ needs.prepare.outputs.ct-matrix }} ct-matrix: ${{ needs.prepare.outputs.ct-matrix }}

View File

@ -28,9 +28,6 @@ on:
builder_vsn: builder_vsn:
required: true required: true
type: string type: string
runner_labels:
required: true
type: string
secrets: secrets:
DOCKER_HUB_USER: DOCKER_HUB_USER:
required: true required: true
@ -70,14 +67,10 @@ on:
required: false required: false
type: string type: string
default: '5.2-3' default: '5.2-3'
runner_labels:
required: false
type: string
default: '["self-hosted","ephemeral","linux","x64"]'
jobs: jobs:
docker: docker:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
strategy: strategy:
fail-fast: false fail-fast: false

View File

@ -7,9 +7,6 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs: inputs:
runner_labels:
required: true
type: string
otp_vsn: otp_vsn:
required: true required: true
type: string type: string
@ -25,7 +22,7 @@ on:
jobs: jobs:
docker: docker:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
env: env:
EMQX_NAME: ${{ matrix.profile }} EMQX_NAME: ${{ matrix.profile }}
PKG_VSN: ${{ startsWith(matrix.profile, 'emqx-enterprise') && inputs.version-emqx-enterprise || inputs.version-emqx }} PKG_VSN: ${{ startsWith(matrix.profile, 'emqx-enterprise') && inputs.version-emqx-enterprise || inputs.version-emqx }}

View File

@ -115,6 +115,7 @@ jobs:
with: with:
name: ${{ matrix.profile }} name: ${{ matrix.profile }}
path: _packages/${{ matrix.profile }}/ path: _packages/${{ matrix.profile }}/
retention-days: 7
mac: mac:
strategy: strategy:
@ -149,9 +150,10 @@ jobs:
with: with:
name: ${{ matrix.profile }} name: ${{ matrix.profile }}
path: _packages/${{ matrix.profile }}/ path: _packages/${{ matrix.profile }}/
retention-days: 7
linux: linux:
runs-on: ['self-hosted', 'ephemeral', 'linux', "${{ matrix.arch }}"] runs-on: [self-hosted, ephemeral, linux, "${{ matrix.arch }}"]
# always run in builder container because the host might have the wrong OTP version etc. # always run in builder container because the host might have the wrong OTP version etc.
# otherwise buildx.sh does not run docker if arch and os matches the target arch and os. # otherwise buildx.sh does not run docker if arch and os matches the target arch and os.
container: container:
@ -199,8 +201,6 @@ jobs:
shell: bash shell: bash
steps: steps:
- uses: AutoModality/action-clean@v1
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
ref: ${{ github.event.inputs.ref }} ref: ${{ github.event.inputs.ref }}
@ -246,6 +246,7 @@ jobs:
with: with:
name: ${{ matrix.profile }} name: ${{ matrix.profile }}
path: _packages/${{ matrix.profile }}/ path: _packages/${{ matrix.profile }}/
retention-days: 7
publish_artifacts: publish_artifacts:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -12,7 +12,7 @@ on:
jobs: jobs:
linux: linux:
if: github.repository_owner == 'emqx' if: github.repository_owner == 'emqx'
runs-on: ['self-hosted', 'ephemeral', 'linux', "${{ matrix.arch }}"] runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
container: container:
image: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}" image: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}"
@ -21,7 +21,6 @@ jobs:
matrix: matrix:
profile: profile:
- ['emqx', 'master'] - ['emqx', 'master']
- ['emqx-enterprise', 'release-52']
- ['emqx-enterprise', 'release-53'] - ['emqx-enterprise', 'release-53']
otp: otp:
- 25.3.2-2 - 25.3.2-2
@ -77,6 +76,7 @@ jobs:
with: with:
name: ${{ matrix.profile[0] }} name: ${{ matrix.profile[0] }}
path: _packages/${{ matrix.profile[0] }}/ path: _packages/${{ matrix.profile[0] }}/
retention-days: 7
- name: Send notification to Slack - name: Send notification to Slack
uses: slackapi/slack-github-action@v1.23.0 uses: slackapi/slack-github-action@v1.23.0
if: failure() if: failure()
@ -100,7 +100,6 @@ jobs:
otp: otp:
- 25.3.2-2 - 25.3.2-2
os: os:
- macos-13
- macos-12-arm64 - macos-12-arm64
steps: steps:

View File

@ -7,9 +7,6 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs: inputs:
runner_labels:
required: true
type: string
builder: builder:
required: true required: true
type: string type: string
@ -27,10 +24,6 @@ on:
inputs: inputs:
ref: ref:
required: false required: false
runner_labels:
required: false
type: string
default: '["self-hosted","ephemeral", "linux", "x64"]'
builder: builder:
required: false required: false
type: string type: string
@ -50,7 +43,7 @@ on:
jobs: jobs:
linux: linux:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
env: env:
EMQX_NAME: ${{ matrix.profile[0] }} EMQX_NAME: ${{ matrix.profile[0] }}
@ -113,7 +106,6 @@ jobs:
otp: otp:
- ${{ inputs.otp_vsn }} - ${{ inputs.otp_vsn }}
os: os:
- macos-11
- macos-12-arm64 - macos-12-arm64
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}

View File

@ -3,16 +3,13 @@ name: Check integrity of rebar and mix dependencies
on: on:
workflow_call: workflow_call:
inputs: inputs:
runner_labels:
required: true
type: string
builder: builder:
required: true required: true
type: string type: string
jobs: jobs:
check_deps_integrity: check_deps_integrity:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
container: ${{ inputs.builder }} container: ${{ inputs.builder }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -11,7 +11,7 @@ on:
jobs: jobs:
analyze: analyze:
name: Analyze name: Analyze
runs-on: ubuntu-latest runs-on: ubuntu-22.04
timeout-minutes: 360 timeout-minutes: 360
permissions: permissions:
actions: read actions: read

View File

@ -11,7 +11,7 @@ on:
jobs: jobs:
rerun-failed-jobs: rerun-failed-jobs:
if: github.repository_owner == 'emqx' if: github.repository_owner == 'emqx'
runs-on: ['self-hosted', 'linux', 'x64', 'ephemeral'] runs-on: ubuntu-22.04
permissions: permissions:
checks: read checks: read
actions: write actions: write

View File

@ -7,16 +7,13 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs: inputs:
runner_labels:
required: true
type: string
builder: builder:
required: true required: true
type: string type: string
jobs: jobs:
run_conf_tests: run_conf_tests:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
container: ${{ inputs.builder }} container: ${{ inputs.builder }}
env: env:
PROFILE: ${{ matrix.profile }} PROFILE: ${{ matrix.profile }}
@ -45,4 +42,4 @@ jobs:
with: with:
name: logs-${{ matrix.profile }} name: logs-${{ matrix.profile }}
path: _build/${{ matrix.profile }}/rel/emqx/logs path: _build/${{ matrix.profile }}/rel/emqx/logs
retention-days: 7

View File

@ -7,9 +7,6 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs: inputs:
runner_labels:
required: true
type: string
version-emqx: version-emqx:
required: true required: true
type: string type: string
@ -19,7 +16,7 @@ on:
jobs: jobs:
basic-tests: basic-tests:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
defaults: defaults:
run: run:
shell: bash shell: bash
@ -63,7 +60,7 @@ jobs:
docker compose rm -fs docker compose rm -fs
paho-mqtt-testing: paho-mqtt-testing:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ github.repository_owner == 'emqx' && fromJSON('["self-hosted","ephemeral","linux","x64"]') || 'ubuntu-22.04' }}
defaults: defaults:
run: run:
shell: bash shell: bash

View File

@ -10,9 +10,6 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs: inputs:
runner_labels:
required: true
type: string
builder: builder:
required: true required: true
type: string type: string
@ -28,7 +25,7 @@ env:
jobs: jobs:
run_emqx_app_tests: run_emqx_app_tests:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
container: ${{ inputs.builder }} container: ${{ inputs.builder }}
defaults: defaults:
@ -63,3 +60,4 @@ jobs:
with: with:
name: logs-emqx-app-tests name: logs-emqx-app-tests
path: apps/emqx/_build/test/logs path: apps/emqx/_build/test/logs
retention-days: 7

View File

@ -7,9 +7,6 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs: inputs:
runner_labels:
required: true
type: string
version-emqx: version-emqx:
required: true required: true
type: string type: string
@ -19,7 +16,7 @@ on:
jobs: jobs:
helm_test: helm_test:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ github.repository_owner == 'emqx' && fromJSON('["self-hosted","ephemeral","linux","x64"]') || 'ubuntu-22.04' }}
defaults: defaults:
run: run:
shell: bash shell: bash

View File

@ -3,16 +3,13 @@ name: JMeter integration tests
on: on:
workflow_call: workflow_call:
inputs: inputs:
runner_labels:
required: true
type: string
version-emqx: version-emqx:
required: true required: true
type: string type: string
jobs: jobs:
jmeter_artifact: jmeter_artifact:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
steps: steps:
- name: Cache Jmeter - name: Cache Jmeter
id: cache-jmeter id: cache-jmeter
@ -39,9 +36,10 @@ jobs:
with: with:
name: apache-jmeter.tgz name: apache-jmeter.tgz
path: /tmp/apache-jmeter.tgz path: /tmp/apache-jmeter.tgz
retention-days: 3
advanced_feat: advanced_feat:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ github.repository_owner == 'emqx' && fromJSON('["self-hosted","ephemeral","linux","x64"]') || 'ubuntu-22.04' }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -90,9 +88,10 @@ jobs:
with: with:
name: jmeter_logs name: jmeter_logs
path: ./jmeter_logs path: ./jmeter_logs
retention-days: 3
pgsql_authn_authz: pgsql_authn_authz:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ github.repository_owner == 'emqx' && fromJSON('["self-hosted","ephemeral","linux","x64"]') || 'ubuntu-22.04' }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -156,9 +155,10 @@ jobs:
with: with:
name: jmeter_logs name: jmeter_logs
path: ./jmeter_logs path: ./jmeter_logs
retention-days: 3
mysql_authn_authz: mysql_authn_authz:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ github.repository_owner == 'emqx' && fromJSON('["self-hosted","ephemeral","linux","x64"]') || 'ubuntu-22.04' }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -215,9 +215,10 @@ jobs:
with: with:
name: jmeter_logs name: jmeter_logs
path: ./jmeter_logs path: ./jmeter_logs
retention-days: 3
JWT_authn: JWT_authn:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ github.repository_owner == 'emqx' && fromJSON('["self-hosted","ephemeral","linux","x64"]') || 'ubuntu-22.04' }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -266,9 +267,10 @@ jobs:
with: with:
name: jmeter_logs name: jmeter_logs
path: ./jmeter_logs path: ./jmeter_logs
retention-days: 3
built_in_database_authn_authz: built_in_database_authn_authz:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ github.repository_owner == 'emqx' && fromJSON('["self-hosted","ephemeral","linux","x64"]') || 'ubuntu-22.04' }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -309,3 +311,4 @@ jobs:
with: with:
name: jmeter_logs name: jmeter_logs
path: ./jmeter_logs path: ./jmeter_logs
retention-days: 3

View File

@ -7,16 +7,13 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs: inputs:
runner:
required: true
type: string
builder: builder:
required: true required: true
type: string type: string
jobs: jobs:
relup_test_plan: relup_test_plan:
runs-on: ["${{ inputs.runner }}", 'linux', 'x64', 'ephemeral'] runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
container: ${{ inputs.builder }} container: ${{ inputs.builder }}
outputs: outputs:
CUR_EE_VSN: ${{ steps.find-versions.outputs.CUR_EE_VSN }} CUR_EE_VSN: ${{ steps.find-versions.outputs.CUR_EE_VSN }}
@ -54,12 +51,13 @@ jobs:
_packages _packages
scripts scripts
.ci .ci
retention-days: 7
relup_test_run: relup_test_run:
needs: needs:
- relup_test_plan - relup_test_plan
if: needs.relup_test_plan.outputs.OLD_VERSIONS != '[]' if: needs.relup_test_plan.outputs.OLD_VERSIONS != '[]'
runs-on: ["${{ inputs.runner }}", 'linux', 'x64', 'ephemeral'] runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -117,3 +115,4 @@ jobs:
name: debug_data name: debug_data
path: | path: |
lux_logs lux_logs
retention-days: 3

View File

@ -7,9 +7,6 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs: inputs:
runner_labels:
required: true
type: string
builder: builder:
required: true required: true
type: string type: string
@ -28,7 +25,7 @@ env:
jobs: jobs:
eunit_and_proper: eunit_and_proper:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ github.repository_owner == 'emqx' && fromJSON('["self-hosted","ephemeral","linux","x64"]') || 'ubuntu-22.04' }}
name: "eunit_and_proper (${{ matrix.profile }})" name: "eunit_and_proper (${{ matrix.profile }})"
strategy: strategy:
fail-fast: false fail-fast: false
@ -68,9 +65,10 @@ jobs:
with: with:
name: coverdata name: coverdata
path: _build/test/cover path: _build/test/cover
retention-days: 7
ct_docker: ct_docker:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ github.repository_owner == 'emqx' && fromJSON('["self-hosted","ephemeral","linux","x64"]') || 'ubuntu-22.04' }}
name: "${{ matrix.app }}-${{ matrix.suitegroup }} (${{ matrix.profile }})" name: "${{ matrix.app }}-${{ matrix.suitegroup }} (${{ matrix.profile }})"
strategy: strategy:
fail-fast: false fail-fast: false
@ -111,6 +109,7 @@ jobs:
with: with:
name: coverdata name: coverdata
path: _build/test/cover path: _build/test/cover
retention-days: 7
- name: compress logs - name: compress logs
if: failure() if: failure()
run: tar -czf logs.tar.gz _build/test/logs run: tar -czf logs.tar.gz _build/test/logs
@ -119,9 +118,10 @@ jobs:
with: with:
name: logs-${{ matrix.profile }}-${{ matrix.prefix }}-${{ matrix.otp }}-sg${{ matrix.suitegroup }} name: logs-${{ matrix.profile }}-${{ matrix.prefix }}-${{ matrix.otp }}-sg${{ matrix.suitegroup }}
path: logs.tar.gz path: logs.tar.gz
retention-days: 7
ct: ct:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ github.repository_owner == 'emqx' && fromJSON('["self-hosted","ephemeral","linux","x64"]') || 'ubuntu-22.04' }}
name: "${{ matrix.app }}-${{ matrix.suitegroup }} (${{ matrix.profile }})" name: "${{ matrix.app }}-${{ matrix.suitegroup }} (${{ matrix.profile }})"
strategy: strategy:
fail-fast: false fail-fast: false
@ -156,6 +156,7 @@ jobs:
name: coverdata name: coverdata
path: _build/test/cover path: _build/test/cover
if-no-files-found: warn # do not fail if no coverdata found if-no-files-found: warn # do not fail if no coverdata found
retention-days: 7
- name: compress logs - name: compress logs
if: failure() if: failure()
run: tar -czf logs.tar.gz _build/test/logs run: tar -czf logs.tar.gz _build/test/logs
@ -164,13 +165,14 @@ jobs:
with: with:
name: logs-${{ matrix.profile }}-${{ matrix.prefix }}-${{ matrix.otp }}-sg${{ matrix.suitegroup }} name: logs-${{ matrix.profile }}-${{ matrix.prefix }}-${{ matrix.otp }}-sg${{ matrix.suitegroup }}
path: logs.tar.gz path: logs.tar.gz
retention-days: 7
tests_passed: tests_passed:
needs: needs:
- eunit_and_proper - eunit_and_proper
- ct - ct
- ct_docker - ct_docker
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ubuntu-22.04
strategy: strategy:
fail-fast: false fail-fast: false
steps: steps:
@ -181,7 +183,7 @@ jobs:
- eunit_and_proper - eunit_and_proper
- ct - ct
- ct_docker - ct_docker
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
container: ${{ inputs.builder }} container: ${{ inputs.builder }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -221,7 +223,7 @@ jobs:
# do this in a separate job # do this in a separate job
upload_coverdata: upload_coverdata:
needs: make_cover needs: make_cover
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ubuntu-22.04
steps: steps:
- name: Coveralls Finished - name: Coveralls Finished
env: env:

View File

@ -6,10 +6,6 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs:
runner_labels:
required: true
type: string
jobs: jobs:
spellcheck: spellcheck:
@ -18,7 +14,7 @@ jobs:
profile: profile:
- emqx - emqx
- emqx-enterprise - emqx-enterprise
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
steps: steps:
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:

View File

@ -11,7 +11,7 @@ on:
jobs: jobs:
stale: stale:
if: github.repository_owner == 'emqx' if: github.repository_owner == 'emqx'
runs-on: ['self-hosted', 'linux', 'x64', 'ephemeral'] runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
permissions: permissions:
issues: write issues: write
pull-requests: none pull-requests: none

View File

@ -7,9 +7,6 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs: inputs:
runner_labels:
required: true
type: string
builder: builder:
required: true required: true
type: string type: string
@ -22,7 +19,7 @@ env:
jobs: jobs:
static_checks: static_checks:
runs-on: ${{ fromJSON(inputs.runner_labels) }} runs-on: ${{ github.repository_owner == 'emqx' && fromJSON('["self-hosted","ephemeral","linux","x64"]') || 'ubuntu-22.04' }}
name: "static_checks (${{ matrix.profile }})" name: "static_checks (${{ matrix.profile }})"
strategy: strategy:
fail-fast: false fail-fast: false

View File

@ -91,6 +91,9 @@ matrix() {
entries+=("$(format_app_entry "$app" 1 emqx "$runner")") entries+=("$(format_app_entry "$app" 1 emqx "$runner")")
entries+=("$(format_app_entry "$app" 1 emqx-enterprise "$runner")") entries+=("$(format_app_entry "$app" 1 emqx-enterprise "$runner")")
;; ;;
apps/emqx_bridge_kafka)
entries+=("$(format_app_entry "$app" 3 emqx-enterprise "$runner")")
;;
apps/emqx_connector) apps/emqx_connector)
entries+=("$(format_app_entry "$app" 1 emqx "$runner")") entries+=("$(format_app_entry "$app" 1 emqx "$runner")")
entries+=("$(format_app_entry "$app" 1 emqx-enterprise "$runner")") entries+=("$(format_app_entry "$app" 1 emqx-enterprise "$runner")")