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

View File

@ -6,6 +6,22 @@ concurrency:
on:
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:
# push:
# branches:
@ -26,7 +42,7 @@ on:
jobs:
linux:
runs-on: ${{ env.RUNNER }}
runs-on: ${{ inputs.runner }}
env:
EMQX_NAME: ${{ matrix.profile[0] }}
@ -39,7 +55,7 @@ jobs:
- ["emqx-enterprise", "25.3.2-1", "amzn2023", "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:
- uses: AutoModality/action-clean@v1
@ -138,7 +154,7 @@ jobs:
- emqx
- emqx-enterprise
otp:
- ${{ env.OTP_VSN }}
- ${{ inputs.otp_vsn }}
os:
- macos-12-arm64
- macos-13

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,6 +7,12 @@ concurrency:
on:
workflow_call:
inputs:
runner:
required: true
type: string
builder:
required: true
type: string
ct-matrix:
required: true
type: string
@ -32,7 +38,7 @@ env:
jobs:
eunit_and_proper:
runs-on: ${{ env.RUNNER }}
runs-on: ${{ inputs.runner }}
strategy:
fail-fast: false
matrix:
@ -72,7 +78,7 @@ jobs:
path: _build/test/cover
ct_docker:
runs-on: ${{ env.RUNNER }}
runs-on: ${{ inputs.runner }}
strategy:
fail-fast: false
matrix:
@ -119,7 +125,7 @@ jobs:
path: _build/test/logs
ct:
runs-on: ${{ env.RUNNER }}
runs-on: ${{ inputs.runner }}
strategy:
fail-fast: false
matrix:
@ -164,8 +170,8 @@ jobs:
- eunit_and_proper
- ct
- ct_docker
runs-on: ${{ env.RUNNER }}
container: ${{ env.BUILDER }}
runs-on: ${{ inputs.runner }}
container: ${{ inputs.builder }}
strategy:
fail-fast: false
matrix:
@ -205,7 +211,7 @@ jobs:
# do this in a separate job
upload_coverdata:
needs: make_cover
runs-on: ${{ env.RUNNER }}
runs-on: ${{ inputs.runner }}
steps:
- name: Coveralls Finished
env:

View File

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

View File

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