From 08b2b36b87f2bcf8bb570080d6bbb712d906254b Mon Sep 17 00:00:00 2001 From: Andrew Mayorov Date: Fri, 13 Oct 2023 00:40:25 +0700 Subject: [PATCH] feat(ci): push some envs through artifact files in workflows So that we could optimize away the need for the full git history. --- .github/workflows/_pr_entrypoint.yaml | 4 ++-- .github/workflows/_push-entrypoint.yaml | 2 ++ .github/workflows/run_conf_tests.yaml | 10 +--------- .github/workflows/static_checks.yaml | 3 +-- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/_pr_entrypoint.yaml b/.github/workflows/_pr_entrypoint.yaml index dd2edfaa9..930182c7e 100644 --- a/.github/workflows/_pr_entrypoint.yaml +++ b/.github/workflows/_pr_entrypoint.yaml @@ -139,6 +139,8 @@ jobs: run: | make ensure-rebar3 make ${PROFILE}-compile test-compile + echo "PROFILE=${PROFILE}" | tee -a .env + echo "PKG_VSN=$(./pkg-vsn.sh ${PROFILE})" | tee -a .env zip -ryq -x@.github/workflows/.zipignore $PROFILE.zip . - uses: actions/upload-artifact@v3 with: @@ -217,8 +219,6 @@ jobs: with: runner_labels: ${{ needs.sanity-checks.outputs.runner_labels }} builder: ${{ needs.sanity-checks.outputs.builder }} - version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }} - version-emqx-enterprise: ${{ needs.sanity-checks.outputs.version-emqx-enterprise }} check_deps_integrity: needs: diff --git a/.github/workflows/_push-entrypoint.yaml b/.github/workflows/_push-entrypoint.yaml index 19c25fa2d..b2d7e2c4a 100644 --- a/.github/workflows/_push-entrypoint.yaml +++ b/.github/workflows/_push-entrypoint.yaml @@ -149,6 +149,8 @@ jobs: ENABLE_COVER_COMPILE: 1 run: | make $PROFILE + echo "PROFILE=${PROFILE}" | tee -a .env + echo "PKG_VSN=$(./pkg-vsn.sh ${PROFILE})" | tee -a .env zip -ryq -x@.github/workflows/.zipignore $PROFILE.zip . - uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/run_conf_tests.yaml b/.github/workflows/run_conf_tests.yaml index c91291836..788c9c9fa 100644 --- a/.github/workflows/run_conf_tests.yaml +++ b/.github/workflows/run_conf_tests.yaml @@ -13,20 +13,11 @@ on: builder: required: true type: string - version-emqx: - required: false - type: string - version-emqx-enterprise: - required: false - type: string jobs: run_conf_tests: runs-on: ${{ fromJSON(inputs.runner_labels) }} container: ${{ inputs.builder }} - env: - PROFILE: ${{ matrix.profile }} - PKG_VSN: ${{ startsWith(matrix.profile, 'emqx-enterprise') && inputs.version-emqx-enterprise || inputs.version-emqx }} strategy: fail-fast: false matrix: @@ -41,6 +32,7 @@ jobs: run: | unzip -o -q ${{ matrix.profile }}.zip git config --global --add safe.directory "$GITHUB_WORKSPACE" + - run: cat .env | tee -a $GITHUB_ENV - run: make ${{ matrix.profile }} - run: ./scripts/test/check-example-configs.sh - run: ./scripts/conf-test/run.sh diff --git a/.github/workflows/static_checks.yaml b/.github/workflows/static_checks.yaml index 758c3712b..6cf89275c 100644 --- a/.github/workflows/static_checks.yaml +++ b/.github/workflows/static_checks.yaml @@ -43,7 +43,6 @@ jobs: key: rebar3-dialyzer-plt-${{ matrix.profile }}-${{ matrix.otp }}-${{ hashFiles('rebar.*', 'apps/*/rebar.*', 'lib-ee/*/rebar.*') }} restore-keys: | rebar3-dialyzer-plt-${{ matrix.profile }}-${{ matrix.otp }}- + - run: cat .env | tee -a $GITHUB_ENV - name: run static checks - env: - PROFILE: ${{ matrix.profile }} run: make static_checks