ci: fix misuse of env

This commit is contained in:
Ivan Dyachkov 2023-08-02 17:33:04 +02:00
parent 3c4d5bdde7
commit 05a51306f9
11 changed files with 142 additions and 49 deletions

View File

@ -8,19 +8,22 @@ env:
OTP_VSN: "25.3.2-1" OTP_VSN: "25.3.2-1"
ELIXIR_VSN: "1.14.5" ELIXIR_VSN: "1.14.5"
BUILDER_VSN: "25.3.2-1" BUILDER_VSN: "25.3.2-1"
BUILDER: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04"
RUNNER: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }}
jobs: jobs:
sanity-checks: sanity-checks:
runs-on: ${{ env.RUNNER }} runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }}
container: ${{ env.BUILDER }} container: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04"
outputs: outputs:
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 }}
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: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }}
builder: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04"
builder_vsn: "25.3.2-1"
otp_vsn: "25.3.2-1"
elixir_vsn: "1.14.5"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -56,8 +59,8 @@ 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: ${{ env.RUNNER }} runs-on: ${{ needs.sanity-checks.outputs.runner }}
container: ${{ env.BUILDER }} container: ${{ needs.sanity-checks.outputs.builder }}
needs: needs:
- sanity-checks - sanity-checks
strategy: strategy:
@ -92,6 +95,8 @@ jobs:
- compile - compile
uses: ./.github/workflows/run_test_cases.yaml uses: ./.github/workflows/run_test_cases.yaml
with: with:
runner: ${{ needs.sanity-checks.outputs.runner }}
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 }}
ct-docker: ${{ needs.sanity-checks.outputs.ct-docker }} ct-docker: ${{ needs.sanity-checks.outputs.ct-docker }}
@ -102,48 +107,72 @@ jobs:
- compile - compile
uses: ./.github/workflows/static_checks.yaml uses: ./.github/workflows/static_checks.yaml
with: with:
runner: ${{ needs.sanity-checks.outputs.runner }}
builder: ${{ needs.sanity-checks.outputs.builder }}
ct-matrix: ${{ needs.sanity-checks.outputs.ct-matrix }} ct-matrix: ${{ needs.sanity-checks.outputs.ct-matrix }}
# build_slim_packages: build_slim_packages:
# needs: needs:
# - sanity-checks - sanity-checks
# uses: ./.github/workflows/build_slim_packages.yaml uses: ./.github/workflows/build_slim_packages.yaml
with:
runner: ${{ needs.sanity-checks.outputs.runner }}
builder: ${{ needs.sanity-checks.outputs.builder }}
builder_vsn: ${{ needs.sanity-checks.outputs.builder_vsn }}
otp_vsn: ${{ needs.sanity-checks.outputs.otp_vsn }}
elixir_vsn: ${{ needs.sanity-checks.outputs.elixir_vsn }}
build_docker_for_test: build_docker_for_test:
needs: needs:
- sanity-checks - sanity-checks
uses: ./.github/workflows/build_docker_for_test.yaml uses: ./.github/workflows/build_docker_for_test.yaml
with: with:
runner: ${{ needs.sanity-checks.outputs.runner }}
builder: ${{ needs.sanity-checks.outputs.builder }}
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 }}
# spellcheck: spellcheck:
# needs: needs:
# - build_slim_packages - build_slim_packages
# uses: ./.github/workflows/spellcheck.yaml uses: ./.github/workflows/spellcheck.yaml
with:
runner: ${{ needs.sanity-checks.outputs.runner }}
run_conf_tests: run_conf_tests:
needs: needs:
- sanity-checks - sanity-checks
- compile - compile
uses: ./.github/workflows/run_conf_tests.yaml uses: ./.github/workflows/run_conf_tests.yaml
with:
runner: ${{ needs.sanity-checks.outputs.runner }}
builder: ${{ needs.sanity-checks.outputs.builder }}
check_deps_integrity: check_deps_integrity:
needs: needs:
- sanity-checks - sanity-checks
uses: ./.github/workflows/check_deps_integrity.yaml uses: ./.github/workflows/check_deps_integrity.yaml
with:
runner: ${{ needs.sanity-checks.outputs.runner }}
builder: ${{ needs.sanity-checks.outputs.builder }}
elixir_release: elixir_release:
needs: needs:
- sanity-checks - sanity-checks
- compile - compile
uses: ./.github/workflows/elixir_release.yaml uses: ./.github/workflows/elixir_release.yaml
with:
runner: ${{ needs.sanity-checks.outputs.runner }}
builder: ${{ needs.sanity-checks.outputs.builder }}
run_relup_tests: run_relup_tests:
needs: needs:
- sanity-checks - sanity-checks
- compile - compile
uses: ./.github/workflows/run_relup_tests.yaml uses: ./.github/workflows/run_relup_tests.yaml
with:
runner: ${{ needs.sanity-checks.outputs.runner }}
builder: ${{ needs.sanity-checks.outputs.builder }}
run_jmeter_tests: run_jmeter_tests:
needs: needs:
@ -151,6 +180,7 @@ 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: ${{ needs.sanity-checks.outputs.runner }}
version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }} version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }}
run_docker_tests: run_docker_tests:
@ -159,6 +189,7 @@ 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: ${{ needs.sanity-checks.outputs.runner }}
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

@ -6,6 +6,22 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs:
runner:
required: true
type: string
builder:
required: true
type: string
builder_vsn:
required: true
type: string
otp_vsn:
required: true
type: string
elixir_vsn:
required: true
type: string
# on: # on:
# push: # push:
# branches: # branches:
@ -26,7 +42,7 @@ on:
jobs: jobs:
linux: linux:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
env: env:
EMQX_NAME: ${{ matrix.profile[0] }} EMQX_NAME: ${{ matrix.profile[0] }}
@ -39,7 +55,7 @@ jobs:
- ["emqx-enterprise", "25.3.2-1", "amzn2023", "erlang"] - ["emqx-enterprise", "25.3.2-1", "amzn2023", "erlang"]
- ["emqx-enterprise", "25.3.2-1", "ubuntu20.04", "erlang"] - ["emqx-enterprise", "25.3.2-1", "ubuntu20.04", "erlang"]
container: "ghcr.io/emqx/emqx-builder/${{ env.BUILDER }}:${{ env.ELIXIR }}-${{ matrix.profile[1] }}-${{ matrix.profile[2] }}" container: "ghcr.io/emqx/emqx-builder/${{ inputs.builder_vsn }}:${{ inputs.elixir_vsn }}-${{ matrix.profile[1] }}-${{ matrix.profile[2] }}"
steps: steps:
- uses: AutoModality/action-clean@v1 - uses: AutoModality/action-clean@v1
@ -138,7 +154,7 @@ jobs:
- emqx - emqx
- emqx-enterprise - emqx-enterprise
otp: otp:
- ${{ env.OTP_VSN }} - ${{ inputs.otp_vsn }}
os: os:
- macos-12-arm64 - macos-12-arm64
- macos-13 - macos-13

View File

@ -2,11 +2,18 @@ name: Check integrity of rebar and mix dependencies
on: on:
workflow_call: workflow_call:
inputs:
runner:
required: true
ty pe: string
builder:
required: true
type: string
jobs: jobs:
check_deps_integrity: check_deps_integrity:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
container: ${{ env.BUILDER }} container: ${{ inputs.builder }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

View File

@ -7,14 +7,21 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs:
runner:
required: true
type: string
builder:
required: true
type: string
# on: # on:
# pull_request: # pull_request:
# workflow_dispatch: # workflow_dispatch:
jobs: jobs:
elixir_release_build: elixir_release_build:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
container: ${{ env.BUILDER }} container: ${{ inputs.builder }}
strategy: strategy:
matrix: matrix:
profile: profile:

View File

@ -6,6 +6,13 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs:
runner:
required: true
type: string
builder:
required: true
type: string
# on: # on:
# push: # push:
@ -19,8 +26,10 @@ on:
jobs: jobs:
run_conf_tests: run_conf_tests:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
container: ${{ env.BUILDER }} container: ${{ inputs.builder }}
env:
PROFILE: ${{ matrix.profile }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -36,14 +45,8 @@ jobs:
run: | run: |
unzip -o -q ${{ matrix.profile }}.zip unzip -o -q ${{ matrix.profile }}.zip
git config --global --add safe.directory "$GITHUB_WORKSPACE" git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: check example config files - run: ./scripts/test/check-example-configs.sh
env: - run: ./scripts/conf-test/run.sh
PROFILE: ${{ matrix.profile }}
run: ./scripts/test/check-example-configs.sh
- name: run conf tests
env:
PROFILE: ${{ matrix.profile }}
run: ./scripts/conf-test/run.sh
- name: print erlang log - name: print erlang log
if: failure() if: failure()
run: | run: |

View File

@ -7,6 +7,9 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs: inputs:
runner:
required: true
type: string
version-emqx: version-emqx:
required: true required: true
type: string type: string
@ -25,7 +28,7 @@ on:
jobs: jobs:
basic-tests: basic-tests:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -68,7 +71,7 @@ jobs:
docker compose rm -fs docker compose rm -fs
pytest: pytest:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
env: env:
EMQX_NAME: ${{ matrix.profile }} EMQX_NAME: ${{ matrix.profile }}
PKG_VSN: ${{ matrix.profile == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }} PKG_VSN: ${{ matrix.profile == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }}

View File

@ -3,6 +3,9 @@ name: JMeter integration tests
on: on:
workflow_call: workflow_call:
inputs: inputs:
runner:
required: true
type: string
version-emqx: version-emqx:
required: true required: true
type: string type: string
@ -16,7 +19,7 @@ on:
jobs: jobs:
jmeter_artifact: jmeter_artifact:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
steps: steps:
- uses: AutoModality/action-clean@v1 - uses: AutoModality/action-clean@v1
- name: Cache Jmeter - name: Cache Jmeter
@ -46,7 +49,7 @@ jobs:
path: /tmp/apache-jmeter.tgz path: /tmp/apache-jmeter.tgz
advanced_feat: advanced_feat:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -103,7 +106,7 @@ jobs:
path: ./jmeter_logs path: ./jmeter_logs
pgsql_authn_authz: pgsql_authn_authz:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -181,7 +184,7 @@ jobs:
path: ./jmeter_logs path: ./jmeter_logs
mysql_authn_authz: mysql_authn_authz:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -252,7 +255,7 @@ jobs:
path: ./jmeter_logs path: ./jmeter_logs
JWT_authn: JWT_authn:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -315,7 +318,7 @@ jobs:
path: ./jmeter_logs path: ./jmeter_logs
built_in_database_authn_authz: built_in_database_authn_authz:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
strategy: strategy:
fail-fast: false fail-fast: false

View File

@ -6,6 +6,13 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs:
runner:
required: true
type: string
builder:
required: true
type: string
# on: # on:
# push: # push:
# branches: # branches:
@ -16,8 +23,8 @@ on:
jobs: jobs:
relup_test_plan: relup_test_plan:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
container: ${{ env.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 }}
OLD_VERSIONS: ${{ steps.find-versions.outputs.OLD_VERSIONS }} OLD_VERSIONS: ${{ steps.find-versions.outputs.OLD_VERSIONS }}

View File

@ -7,6 +7,12 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs: inputs:
runner:
required: true
type: string
builder:
required: true
type: string
ct-matrix: ct-matrix:
required: true required: true
type: string type: string
@ -32,7 +38,7 @@ env:
jobs: jobs:
eunit_and_proper: eunit_and_proper:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -72,7 +78,7 @@ jobs:
path: _build/test/cover path: _build/test/cover
ct_docker: ct_docker:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -119,7 +125,7 @@ jobs:
path: _build/test/logs path: _build/test/logs
ct: ct:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -164,8 +170,8 @@ jobs:
- eunit_and_proper - eunit_and_proper
- ct - ct
- ct_docker - ct_docker
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
container: ${{ env.BUILDER }} container: ${{ inputs.builder }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -205,7 +211,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: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
steps: steps:
- name: Coveralls Finished - name: Coveralls Finished
env: env:

View File

@ -6,6 +6,10 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs:
runner:
required: true
type: string
# on: # on:
# push: # push:
# branches: # branches:
@ -31,7 +35,7 @@ jobs:
profile: profile:
- emqx - emqx
- emqx-enterprise - emqx-enterprise
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
steps: steps:
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:

View File

@ -7,6 +7,12 @@ concurrency:
on: on:
workflow_call: workflow_call:
inputs: inputs:
runner:
required: true
type: string
builder:
required: true
type: string
ct-matrix: ct-matrix:
required: true required: true
type: string type: string
@ -26,7 +32,7 @@ env:
jobs: jobs:
static_checks: static_checks:
runs-on: ${{ env.RUNNER }} runs-on: ${{ inputs.runner }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix: