From 99e5322b685bfea69c59f8424e5b5f77a0bd1e0d Mon Sep 17 00:00:00 2001 From: Massimiliano Giovagnoli Date: Sun, 4 Feb 2024 20:06:04 +0100 Subject: [PATCH] ci: fix codecov job depedency Signed-off-by: Massimiliano Giovagnoli --- .github/actions/exists/action.yaml | 21 +++++++++++++++++++++ .github/actions/setup-caches/action.yaml | 20 ++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .github/actions/exists/action.yaml create mode 100644 .github/actions/setup-caches/action.yaml diff --git a/.github/actions/exists/action.yaml b/.github/actions/exists/action.yaml new file mode 100644 index 0000000..7f9c6dd --- /dev/null +++ b/.github/actions/exists/action.yaml @@ -0,0 +1,21 @@ +name: Checks if an input is defined + +description: Checks if an input is defined and outputs 'true' or 'false'. + +inputs: + value: + description: value to test + required: true + +outputs: + result: + description: outputs 'true' or 'false' if input value is defined or not + value: ${{ steps.check.outputs.result }} + +runs: + using: composite + steps: + - shell: bash + id: check + run: | + echo "result=${{ inputs.value != '' }}" >> $GITHUB_OUTPUT \ No newline at end of file diff --git a/.github/actions/setup-caches/action.yaml b/.github/actions/setup-caches/action.yaml new file mode 100644 index 0000000..622c54d --- /dev/null +++ b/.github/actions/setup-caches/action.yaml @@ -0,0 +1,20 @@ +name: Setup caches + +description: Setup caches for go modules and build cache. + +inputs: + build-cache-key: + description: build cache prefix + +runs: + using: composite + steps: + - uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('**/go.sum') }}-${{ hashFiles('Makefile') }} + - uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2 + if: ${{ inputs.build-cache-key }} + with: + path: ~/.cache/go-build + key: ${{ runner.os }}-build-cache-${{ inputs.build-cache-key }}-${{ hashFiles('**/go.sum') }}-${{ hashFiles('Makefile') }} \ No newline at end of file