From 827cd79ecaf2a5039075c5cd9be94247fc57e895 Mon Sep 17 00:00:00 2001 From: Andrew Mayorov Date: Tue, 2 May 2023 18:43:02 +0300 Subject: [PATCH 1/2] ci: run static checks in separate jobs So that prepare jobs would finish earlier and CI would give faster feedback. Also point cache action at the correct location of the PLT file. --- .github/workflows/run_test_cases.yaml | 37 +++++++++++++++++++++------ Makefile | 7 +++-- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/.github/workflows/run_test_cases.yaml b/.github/workflows/run_test_cases.yaml index 0ebc67e13..b82b545df 100644 --- a/.github/workflows/run_test_cases.yaml +++ b/.github/workflows/run_test_cases.yaml @@ -72,21 +72,14 @@ jobs: - uses: actions/checkout@v3 with: path: source - - uses: actions/cache@v3 - id: cache - with: - path: "$HOME/.cache/rebar3/rebar3_${{ matrix.otp }}_plt" - key: rebar3-dialyzer-plt-${{ matrix.otp }} - name: get_all_deps working-directory: source env: PROFILE: ${{ matrix.profile }} - #DIAGNOSTIC: 1 run: | make ensure-rebar3 # fetch all deps and compile - make ${{ matrix.profile }} - make static_checks + make ${{ matrix.profile }}-compile make test-compile cd .. zip -ryq source.zip source/* source/.[^.]* @@ -95,6 +88,34 @@ jobs: name: source-${{ matrix.profile }}-${{ matrix.otp }} path: source.zip + static_checks: + needs: + - build-matrix + - prepare + runs-on: ${{ needs.build-matrix.outputs.runs-on }} + strategy: + fail-fast: false + matrix: + include: ${{ fromJson(needs.build-matrix.outputs.prepare) }} + container: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-ubuntu22.04" + steps: + - uses: AutoModality/action-clean@v1 + - uses: actions/download-artifact@v3 + with: + name: source-${{ matrix.profile }}-${{ matrix.otp }} + path: . + - name: unzip source code + run: unzip -o -q source.zip + - uses: actions/cache@v3 + with: + path: "source/emqx_dialyzer_${{ matrix.otp }}_plt" + key: rebar3-dialyzer-plt-${{ matrix.profile }}-${{ matrix.otp }} + - name: run static checks + env: + PROFILE: ${{ matrix.profile }} + working-directory: source + run: make static_checks + eunit_and_proper: needs: - build-matrix diff --git a/Makefile b/Makefile index d1a478279..d5046fe64 100644 --- a/Makefile +++ b/Makefile @@ -74,6 +74,10 @@ proper: $(REBAR) test-compile: $(REBAR) merge-config $(REBAR) as test compile +.PHONY: $(REL_PROFILES:%=%-compile) +$(REL_PROFILES:%=%-compile): $(REBAR) merge-config + $(REBAR) as $(@:%-compile=%) compile + .PHONY: ct ct: $(REBAR) merge-config @ENABLE_COVER_COMPILE=1 $(REBAR) ct --name $(CT_NODE_NAME) -c -v --cover_export_name $(CT_COVER_EXPORT_PREFIX)-ct @@ -89,10 +93,9 @@ APPS=$(shell $(SCRIPTS)/find-apps.sh) .PHONY: $(APPS:%=%-ct) define gen-app-ct-target -$1-ct: $(REBAR) +$1-ct: $(REBAR) merge-config $(eval SUITES := $(shell $(SCRIPTS)/find-suites.sh $1)) ifneq ($(SUITES),) - @$(SCRIPTS)/pre-compile.sh $(PROFILE) @ENABLE_COVER_COMPILE=1 $(REBAR) ct -c -v \ --readable=$(CT_READABLE) \ --name $(CT_NODE_NAME) \ From 754045173ed98d160465328c14e30e225649ed04 Mon Sep 17 00:00:00 2001 From: Andrew Mayorov Date: Tue, 2 May 2023 19:15:00 +0300 Subject: [PATCH 2/2] chore: bump `snabbkaffe` to 1.0.8 --- apps/emqx/rebar.config | 2 +- mix.exs | 2 +- rebar.config | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/emqx/rebar.config b/apps/emqx/rebar.config index 5053a353c..18119607e 100644 --- a/apps/emqx/rebar.config +++ b/apps/emqx/rebar.config @@ -33,7 +33,7 @@ {emqx_http_lib, {git, "https://github.com/emqx/emqx_http_lib.git", {tag, "0.5.2"}}}, {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {tag, "2.0.4"}}}, {recon, {git, "https://github.com/ferd/recon", {tag, "2.5.1"}}}, - {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "1.0.7"}}} + {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "1.0.8"}}} ]}. {plugins, [{rebar3_proper, "0.12.1"}, rebar3_path_deps]}. diff --git a/mix.exs b/mix.exs index 4f5ecceea..a24068f49 100644 --- a/mix.exs +++ b/mix.exs @@ -71,7 +71,7 @@ defmodule EMQXUmbrella.MixProject do {:telemetry, "1.1.0"}, # in conflict by emqtt and hocon {:getopt, "1.0.2", override: true}, - {:snabbkaffe, github: "kafka4beam/snabbkaffe", tag: "1.0.7", override: true}, + {:snabbkaffe, github: "kafka4beam/snabbkaffe", tag: "1.0.8", override: true}, {:hocon, github: "emqx/hocon", tag: "0.39.4", override: true}, {:emqx_http_lib, github: "emqx/emqx_http_lib", tag: "0.5.2", override: true}, {:esasl, github: "emqx/esasl", tag: "0.2.0"}, diff --git a/rebar.config b/rebar.config index e11f0c108..03b03345d 100644 --- a/rebar.config +++ b/rebar.config @@ -74,7 +74,7 @@ , {observer_cli, "1.7.1"} % NOTE: depends on recon 2.5.x , {system_monitor, {git, "https://github.com/ieQu1/system_monitor", {tag, "3.0.3"}}} , {getopt, "1.0.2"} - , {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "1.0.7"}}} + , {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "1.0.8"}}} , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.39.4"}}} , {emqx_http_lib, {git, "https://github.com/emqx/emqx_http_lib.git", {tag, "0.5.2"}}} , {esasl, {git, "https://github.com/emqx/esasl", {tag, "0.2.0"}}}