From fab0bc24a0dbb814d53a523e90eac7e64b5fc1d3 Mon Sep 17 00:00:00 2001 From: Andrew Mayorov Date: Wed, 22 Jun 2022 16:38:21 +0300 Subject: [PATCH] Allow to run steps conditionally @ parallel workflow --- .github/workflows/erlang-parallel-build.yml | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/erlang-parallel-build.yml b/.github/workflows/erlang-parallel-build.yml index 8ec0f78..1c83901 100644 --- a/.github/workflows/erlang-parallel-build.yml +++ b/.github/workflows/erlang-parallel-build.yml @@ -130,10 +130,32 @@ jobs: restore-keys: | ${{ inputs.cache-version }}-${{ runner.os }}-otp-${{ inputs.otp-version }}-build- + - name: Check formatting (prereqs) + id: prereq-erlfmt + run: | + if ( rebar3 plugins list | grep 'erlfmt' ) ; then + echo "::set-output name=exists::true" + else + echo "::set-output name=exists::false" + echo "::notice file=rebar.config::Plugin 'erlfmt' is missing, can not check formatting." + fi + - name: Check formatting + if: ${{ steps.prereq-erlfmt.outputs.exists == 'true' }} run: rebar3 fmt -c + - name: Run linting (prereqs) + id: prereq-lint + run: | + if ( rebar3 plugins list | grep 'rebar3_lint' ) ; then + echo "::set-output name=exists::true" + else + echo "::set-output name=exists::false" + echo "::notice file=rebar.config::Plugin 'rebar3_lint' is missing, can not run linting." + fi + - name: Run linting + if: ${{ steps.prereq-lint.outputs.exists == 'true' }} run: rebar3 lint - name: Run xref