mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
GitHub: allow not caching the Golang build cache
This is a tradeoff of disk space (and with that cache size) and compilation speed. Because we're still running into disk full errors with the full build cache, we remove it for the cross compile step. Which means we'll do more work each time.
This commit is contained in:
parent
e68b2ad015
commit
66c3a46e4c
2 changed files with 21 additions and 1 deletions
21
.github/actions/setup-go/action.yml
vendored
21
.github/actions/setup-go/action.yml
vendored
|
@ -7,6 +7,12 @@ inputs:
|
|||
key-prefix:
|
||||
description: "A prefix to use for the cache key, to separate cache entries from other workflows"
|
||||
required: false
|
||||
use-build-cache:
|
||||
description: "Whether to use the build cache"
|
||||
required: false
|
||||
# Boolean values aren't supported in the workflow syntax, so we use a
|
||||
# string. To not confuse the value with true/false, we use 'yes' and 'no'.
|
||||
default: 'yes'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
@ -17,7 +23,8 @@ runs:
|
|||
with:
|
||||
go-version: '${{ inputs.go-version }}'
|
||||
|
||||
- name: go cache
|
||||
- name: go module and build cache
|
||||
if: ${{ inputs.use-build-cache == 'yes' }}
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# In order:
|
||||
|
@ -35,6 +42,18 @@ runs:
|
|||
${{ runner.os }}-go-${{ inputs.go-version }}-${{ inputs.key-prefix }}-${{ github.job }}-
|
||||
${{ runner.os }}-go-${{ inputs.go-version }}-${{ inputs.key-prefix }}-
|
||||
|
||||
- name: go module cache
|
||||
if: ${{ inputs.use-build-cache == 'no' }}
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Just the module download cache.
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ inputs.go-version }}-${{ inputs.key-prefix }}-no-build-cache-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-${{ inputs.go-version }}-${{ inputs.key-prefix }}-no-build-cache-${{ github.job }}-
|
||||
${{ runner.os }}-go-${{ inputs.go-version }}-${{ inputs.key-prefix }}-no-build-cache-
|
||||
|
||||
- name: set GOPATH
|
||||
shell: bash
|
||||
run: |
|
||||
|
|
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
|
@ -148,6 +148,7 @@ jobs:
|
|||
with:
|
||||
go-version: '${{ env.GO_VERSION }}'
|
||||
key-prefix: cross-compile
|
||||
use-build-cache: 'no'
|
||||
|
||||
- name: build release for all architectures
|
||||
run: make release
|
||||
|
|
Loading…
Add table
Reference in a new issue