diff --git a/.github/actions/build/action.yaml b/.github/actions/build/action.yaml index 9b032354..16258047 100644 --- a/.github/actions/build/action.yaml +++ b/.github/actions/build/action.yaml @@ -53,6 +53,35 @@ runs: # set -e # go run generator/main.go build + - name: Determine GOMODCACHE + shell: bash + id: goenv + run: | + set -e + echo "::set-ouput name=gomodcache::$(go env GOMODCACHE)" + + - name: Restore cached GO pkg + id: cache-gopkg + uses: https://code.forgejo.org/actions/cache/restore@v5 + with: + path: ${{ steps.goenv.outputs.gomodcache }} + key: ${{ runner.os }}-gopkg + + - name: Get all go packages + if: steps.cache-gopkg.outputs.cache-hit != 'true' + shell: bash + run: | + set -e + go get ./... + + - name: Save Primes + id: cache-primes-save + uses: https://code.forgejo.org/actions/cache/save@v5 + with: + path: | + ${{ steps.goenv.outputs.gomodcache }} + key: ${{ runner.os }}-gopkg + - name: Run make to build app shell: bash run: |