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