mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 14:11:04 +02:00
Merge pull request #10032 from yyforyongyu/fix-ci-cache
CI: reduce cache size and auto clean caches
This commit is contained in:
16
.github/actions/cleanup-space/action.yml
vendored
Normal file
16
.github/actions/cleanup-space/action.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: "Clean up runner disk space"
|
||||||
|
description: "Removes large, non-essential toolsets to free up disk space on the runner."
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Free up disk space
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "Removing large toolsets to free up disk space..."
|
||||||
|
# Remove dotnet to save disk space.
|
||||||
|
sudo rm -rf /usr/share/dotnet
|
||||||
|
# Remove android to save disk space.
|
||||||
|
sudo rm -rf /usr/local/lib/android
|
||||||
|
# Remove ghc to save disk space.
|
||||||
|
sudo rm -rf /opt/ghc
|
37
.github/actions/setup-go/action.yml
vendored
37
.github/actions/setup-go/action.yml
vendored
@@ -24,6 +24,16 @@ runs:
|
|||||||
go-version: '${{ inputs.go-version }}'
|
go-version: '${{ inputs.go-version }}'
|
||||||
cache: 'false'
|
cache: 'false'
|
||||||
|
|
||||||
|
# When we run go build or go test, the Go compiler calculates a signature
|
||||||
|
# for each package based on the content of its `.go` source files, its
|
||||||
|
# dependencies, and the compiler flags. It then checks the restored build
|
||||||
|
# cache for an entry matching that exact signature to speed up the jobs.
|
||||||
|
# - Cache Hit: If an entry exists (meaning the source files and
|
||||||
|
# dependencies haven't changed), it reuses the compiled artifact directly
|
||||||
|
# from the cache.
|
||||||
|
# - Cache Miss: If no entry exists (because we changed a line of code), it
|
||||||
|
# recompiles that specific package and stores the new result in the cache
|
||||||
|
# for the next time.
|
||||||
- name: go cache
|
- name: go cache
|
||||||
if: ${{ inputs.use-build-cache == 'yes' }}
|
if: ${{ inputs.use-build-cache == 'yes' }}
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -38,11 +48,31 @@ runs:
|
|||||||
~/.cache/go-build
|
~/.cache/go-build
|
||||||
~/Library/Caches/go-build
|
~/Library/Caches/go-build
|
||||||
~\AppData\Local\go-build
|
~\AppData\Local\go-build
|
||||||
key: ${{ runner.os }}-go-${{ inputs.go-version }}-${{ inputs.key-prefix }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
|
||||||
|
# The key is used to create and later look up the cache. It's made of
|
||||||
|
# four parts:
|
||||||
|
# - The base part is made from the OS name, Go version and a
|
||||||
|
# job-specified key prefix. Example: `linux-go-1.23.10-unit-test-`.
|
||||||
|
# It ensures that a job running on Linux with Go 1.23 only looks for
|
||||||
|
# caches from the same environment.
|
||||||
|
# - The unique part is the `hashFiles('**/go.sum')`, which calculates a
|
||||||
|
# hash (a fingerprint) of the go.sum file.
|
||||||
|
key: ${{ runner.os }}-go-${{ inputs.go-version }}-${{ inputs.key-prefix }}-${{ hashFiles('**/go.sum') }}
|
||||||
|
|
||||||
|
# The restore-keys provides a list of fallback keys. If no cache
|
||||||
|
# matches the key exactly, the action will look for a cache where the
|
||||||
|
# key starts with one of the restore-keys. The action searches the
|
||||||
|
# restore-keys list in order and restores the most recently created
|
||||||
|
# cache that matches the prefix. Once the job is done, a new cache is
|
||||||
|
# created and saved using the new key.
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-go-${{ inputs.go-version }}-${{ inputs.key-prefix }}-${{ github.job }}-
|
|
||||||
${{ runner.os }}-go-${{ inputs.go-version }}-${{ inputs.key-prefix }}-
|
${{ runner.os }}-go-${{ inputs.go-version }}-${{ inputs.key-prefix }}-
|
||||||
|
|
||||||
|
# The complete, downloaded source code of all our dependencies (the
|
||||||
|
# libraries lnd project imports). This prevents the go command from having
|
||||||
|
# to re-download every dependency from the internet on every single job
|
||||||
|
# run. It's like having a local library of all the third-party code lnd
|
||||||
|
# needs.
|
||||||
- name: go module cache
|
- name: go module cache
|
||||||
if: ${{ inputs.use-build-cache == 'no' }}
|
if: ${{ inputs.use-build-cache == 'no' }}
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -50,9 +80,8 @@ runs:
|
|||||||
# Just the module download cache.
|
# Just the module download cache.
|
||||||
path: |
|
path: |
|
||||||
~/go/pkg/mod
|
~/go/pkg/mod
|
||||||
key: ${{ runner.os }}-go-${{ inputs.go-version }}-${{ inputs.key-prefix }}-no-build-cache-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
key: ${{ runner.os }}-go-${{ inputs.go-version }}-${{ inputs.key-prefix }}-no-build-cache-${{ hashFiles('**/go.sum') }}
|
||||||
restore-keys: |
|
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-
|
${{ runner.os }}-go-${{ inputs.go-version }}-${{ inputs.key-prefix }}-no-build-cache-
|
||||||
|
|
||||||
- name: set GOPATH
|
- name: set GOPATH
|
||||||
|
292
.github/workflows/main.yml
vendored
292
.github/workflows/main.yml
vendored
@@ -11,6 +11,12 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- "master"
|
- "master"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
# Required to manage and delete caches.
|
||||||
|
actions: write
|
||||||
|
# Default permission for checking out code.
|
||||||
|
contents: read
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
# Cancel any previous workflows if they are from a PR or push.
|
# Cancel any previous workflows if they are from a PR or push.
|
||||||
group: ${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.event.pull_request.number || github.ref }}
|
||||||
@@ -37,60 +43,67 @@ env:
|
|||||||
GO_VERSION: 1.23.10
|
GO_VERSION: 1.23.10
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
########################
|
static-checks:
|
||||||
# SQLC code gen check
|
name: Static Checks
|
||||||
########################
|
|
||||||
sqlc-check:
|
|
||||||
name: Sqlc check
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: cleanup space
|
- name: Git checkout
|
||||||
run: rm -rf /opt/hostedtoolcache
|
|
||||||
|
|
||||||
- name: git checkout
|
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
# Needed for some checks.
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: setup go ${{ env.GO_VERSION }}
|
- name: Clean up runner space
|
||||||
|
uses: ./.github/actions/cleanup-space
|
||||||
|
|
||||||
|
- name: Setup Go ${{ env.GO_VERSION }}
|
||||||
uses: ./.github/actions/setup-go
|
uses: ./.github/actions/setup-go
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.GO_VERSION }}'
|
go-version: '${{ env.GO_VERSION }}'
|
||||||
|
use-build-cache: 'no'
|
||||||
|
|
||||||
- name: docker image cache
|
########################
|
||||||
|
# sample configuration check
|
||||||
|
########################
|
||||||
|
- name: Check default values in sample-lnd.conf file
|
||||||
|
run: make sample-conf-check
|
||||||
|
|
||||||
|
########################
|
||||||
|
# Check code and RPC format
|
||||||
|
########################
|
||||||
|
- name: Check code format
|
||||||
|
run: make fmt-check
|
||||||
|
|
||||||
|
- name: Check go modules tidiness
|
||||||
|
run: make tidy-module-check
|
||||||
|
|
||||||
|
- name: Lint proto files
|
||||||
|
run: make protolint
|
||||||
|
|
||||||
|
########################
|
||||||
|
# SQLC code gen check
|
||||||
|
########################
|
||||||
|
- name: Docker image cache
|
||||||
uses: satackey/action-docker-layer-caching@v0.0.11
|
uses: satackey/action-docker-layer-caching@v0.0.11
|
||||||
# Ignore the failure of a step and avoid terminating the job.
|
# Ignore the failure of a step and avoid terminating the job.
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Generate sql models
|
- name: Check SQL models
|
||||||
run: make sqlc-check
|
run: make sqlc-check
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# RPC and mobile compilation check
|
# RPC and mobile compilation check
|
||||||
########################
|
########################
|
||||||
rpc-check:
|
- name: Check RPC format
|
||||||
name: RPC and mobile compilation check
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: cleanup space
|
|
||||||
run: rm -rf /opt/hostedtoolcache
|
|
||||||
|
|
||||||
- name: git checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: setup go ${{ env.GO_VERSION }}
|
|
||||||
uses: ./.github/actions/setup-go
|
|
||||||
with:
|
|
||||||
go-version: '${{ env.GO_VERSION }}'
|
|
||||||
|
|
||||||
- name: run check
|
|
||||||
run: make rpc-check
|
run: make rpc-check
|
||||||
|
|
||||||
- name: run JSON/WASM stub compilation check
|
- name: Check JSON/WASM stub compilation
|
||||||
run: make rpc-js-compile
|
run: make rpc-js-compile
|
||||||
|
|
||||||
- name: build mobile RPC bindings
|
- name: Check mobile RPC bindings
|
||||||
run: make mobile-rpc
|
run: make mobile-rpc
|
||||||
|
|
||||||
- name: build mobile specific code
|
- name: Check mobile specific code
|
||||||
run: go build --tags="mobile" ./mobile
|
run: go build --tags="mobile" ./mobile
|
||||||
|
|
||||||
########################
|
########################
|
||||||
@@ -98,21 +111,23 @@ jobs:
|
|||||||
########################
|
########################
|
||||||
check-commits:
|
check-commits:
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
name: check commits
|
name: Check commits
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: cleanup space
|
|
||||||
run: rm -rf /opt/hostedtoolcache
|
|
||||||
|
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Clean up runner space
|
||||||
|
uses: ./.github/actions/cleanup-space
|
||||||
|
|
||||||
- name: setup go ${{ env.GO_VERSION }}
|
- name: setup go ${{ env.GO_VERSION }}
|
||||||
uses: ./.github/actions/setup-go
|
uses: ./.github/actions/setup-go
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.GO_VERSION }}'
|
go-version: '${{ env.GO_VERSION }}'
|
||||||
|
# Use the same cache from unit test job to save time.
|
||||||
|
key-prefix: unit-test
|
||||||
|
|
||||||
- name: fetch and rebase on ${{ github.base_ref }}
|
- name: fetch and rebase on ${{ github.base_ref }}
|
||||||
uses: ./.github/actions/rebase
|
uses: ./.github/actions/rebase
|
||||||
@@ -124,30 +139,23 @@ jobs:
|
|||||||
# lint code
|
# lint code
|
||||||
########################
|
########################
|
||||||
lint:
|
lint:
|
||||||
name: lint code
|
name: Lint code
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: cleanup space
|
|
||||||
run: rm -rf /opt/hostedtoolcache
|
|
||||||
|
|
||||||
- name: git checkout
|
- name: git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Clean up runner space
|
||||||
|
uses: ./.github/actions/cleanup-space
|
||||||
|
|
||||||
- name: setup go ${{ env.GO_VERSION }}
|
- name: setup go ${{ env.GO_VERSION }}
|
||||||
uses: ./.github/actions/setup-go
|
uses: ./.github/actions/setup-go
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.GO_VERSION }}'
|
go-version: '${{ env.GO_VERSION }}'
|
||||||
|
# Use the same cache from unit test job to save time.
|
||||||
- name: check code format
|
key-prefix: unit-test
|
||||||
run: make fmt-check
|
|
||||||
|
|
||||||
- name: check go modules tidiness
|
|
||||||
run: make tidy-module-check
|
|
||||||
|
|
||||||
- name: lint proto files
|
|
||||||
run: make protolint
|
|
||||||
|
|
||||||
- name: lint
|
- name: lint
|
||||||
run: GOGC=50 make lint
|
run: GOGC=50 make lint
|
||||||
@@ -156,7 +164,7 @@ jobs:
|
|||||||
# cross compilation
|
# cross compilation
|
||||||
########################
|
########################
|
||||||
cross-compile:
|
cross-compile:
|
||||||
name: cross compilation
|
name: Cross compilation
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
@@ -170,48 +178,27 @@ jobs:
|
|||||||
- name: arm
|
- name: arm
|
||||||
sys: darwin-arm64 freebsd-arm linux-armv6 linux-armv7 linux-arm64 windows-arm
|
sys: darwin-arm64 freebsd-arm linux-armv6 linux-armv7 linux-arm64 windows-arm
|
||||||
steps:
|
steps:
|
||||||
- name: cleanup space
|
- name: Git checkout
|
||||||
run: rm -rf /opt/hostedtoolcache
|
|
||||||
|
|
||||||
- name: git checkout
|
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: setup go ${{ env.GO_VERSION }}
|
- name: Clean up runner space
|
||||||
|
uses: ./.github/actions/cleanup-space
|
||||||
|
|
||||||
|
- name: Setup go ${{ env.GO_VERSION }}
|
||||||
uses: ./.github/actions/setup-go
|
uses: ./.github/actions/setup-go
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.GO_VERSION }}'
|
go-version: '${{ env.GO_VERSION }}'
|
||||||
key-prefix: cross-compile
|
key-prefix: cross-compile
|
||||||
use-build-cache: 'no'
|
use-build-cache: 'no'
|
||||||
|
|
||||||
- name: build release for all architectures
|
- name: Build release for all architectures
|
||||||
run: make release sys="${{ matrix.sys }}"
|
run: make release sys="${{ matrix.sys }}"
|
||||||
|
|
||||||
########################
|
|
||||||
# sample configuration check
|
|
||||||
########################
|
|
||||||
sample-conf-check:
|
|
||||||
name: sample configuration check
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: cleanup space
|
|
||||||
run: rm -rf /opt/hostedtoolcache
|
|
||||||
|
|
||||||
- name: git checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: setup go ${{ env.GO_VERSION }}
|
|
||||||
uses: ./.github/actions/setup-go
|
|
||||||
with:
|
|
||||||
go-version: '${{ env.GO_VERSION }}'
|
|
||||||
|
|
||||||
- name: check default values in sample-lnd.conf file
|
|
||||||
run: make sample-conf-check
|
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# run unit tests
|
# run unit tests
|
||||||
########################
|
########################
|
||||||
unit-test:
|
unit-test:
|
||||||
name: run unit tests
|
name: Run unit tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
# Allow other tests in the matrix to continue if one fails.
|
# Allow other tests in the matrix to continue if one fails.
|
||||||
@@ -228,37 +215,37 @@ jobs:
|
|||||||
- unit-module
|
- unit-module
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: cleanup space
|
- name: Git checkout
|
||||||
run: rm -rf /opt/hostedtoolcache
|
|
||||||
|
|
||||||
- name: git checkout
|
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: fetch and rebase on ${{ github.base_ref }}
|
- name: Clean up runner space
|
||||||
|
uses: ./.github/actions/cleanup-space
|
||||||
|
|
||||||
|
- name: Fetch and rebase on ${{ github.base_ref }}
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
uses: ./.github/actions/rebase
|
uses: ./.github/actions/rebase
|
||||||
|
|
||||||
- name: git checkout fuzzing seeds
|
- name: Git checkout fuzzing seeds
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: lightninglabs/lnd-fuzz
|
repository: lightninglabs/lnd-fuzz
|
||||||
path: lnd-fuzz
|
path: lnd-fuzz
|
||||||
|
|
||||||
- name: rsync fuzzing seeds
|
- name: Rsync fuzzing seeds
|
||||||
run: rsync -a --ignore-existing lnd-fuzz/ ./
|
run: rsync -a --ignore-existing lnd-fuzz/ ./
|
||||||
|
|
||||||
- name: setup go ${{ env.GO_VERSION }}
|
- name: Setup go ${{ env.GO_VERSION }}
|
||||||
uses: ./.github/actions/setup-go
|
uses: ./.github/actions/setup-go
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.GO_VERSION }}'
|
go-version: '${{ env.GO_VERSION }}'
|
||||||
key-prefix: unit-test
|
key-prefix: unit-test
|
||||||
|
|
||||||
- name: install bitcoind
|
- name: Install bitcoind
|
||||||
run: ./scripts/install_bitcoind.sh $BITCOIN_VERSION
|
run: ./scripts/install_bitcoind.sh $BITCOIN_VERSION
|
||||||
|
|
||||||
- name: run ${{ matrix.unit_type }}
|
- name: Run ${{ matrix.unit_type }}
|
||||||
run: make ${{ matrix.unit_type }}
|
run: make ${{ matrix.unit_type }}
|
||||||
|
|
||||||
- name: Clean coverage
|
- name: Clean coverage
|
||||||
@@ -280,7 +267,7 @@ jobs:
|
|||||||
# run integration tests with TRANCHES
|
# run integration tests with TRANCHES
|
||||||
########################
|
########################
|
||||||
basic-integration-test:
|
basic-integration-test:
|
||||||
name: basic itests
|
name: Run basic itests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: '!contains(github.event.pull_request.labels.*.name, ''no-itest'')'
|
if: '!contains(github.event.pull_request.labels.*.name, ''no-itest'')'
|
||||||
strategy:
|
strategy:
|
||||||
@@ -297,28 +284,28 @@ jobs:
|
|||||||
- name: neutrino
|
- name: neutrino
|
||||||
args: backend=neutrino cover=1
|
args: backend=neutrino cover=1
|
||||||
steps:
|
steps:
|
||||||
- name: cleanup space
|
- name: Git checkout
|
||||||
run: rm -rf /opt/hostedtoolcache
|
|
||||||
|
|
||||||
- name: git checkout
|
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: fetch and rebase on ${{ github.base_ref }}
|
- name: Clean up runner space
|
||||||
|
uses: ./.github/actions/cleanup-space
|
||||||
|
|
||||||
|
- name: Fetch and rebase on ${{ github.base_ref }}
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
uses: ./.github/actions/rebase
|
uses: ./.github/actions/rebase
|
||||||
|
|
||||||
- name: setup go ${{ env.GO_VERSION }}
|
- name: Setup go ${{ env.GO_VERSION }}
|
||||||
uses: ./.github/actions/setup-go
|
uses: ./.github/actions/setup-go
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.GO_VERSION }}'
|
go-version: '${{ env.GO_VERSION }}'
|
||||||
key-prefix: integration-test
|
key-prefix: integration-test
|
||||||
|
|
||||||
- name: install bitcoind
|
- name: Install bitcoind
|
||||||
run: ./scripts/install_bitcoind.sh $BITCOIN_VERSION
|
run: ./scripts/install_bitcoind.sh $BITCOIN_VERSION
|
||||||
|
|
||||||
- name: run ${{ matrix.name }}
|
- name: Run ${{ matrix.name }}
|
||||||
run: make itest-parallel tranches=${{ env.TRANCHES }} ${{ matrix.args }} shuffleseed=${{ github.run_id }}${{ strategy.job-index }}
|
run: make itest-parallel tranches=${{ env.TRANCHES }} ${{ matrix.args }} shuffleseed=${{ github.run_id }}${{ strategy.job-index }}
|
||||||
|
|
||||||
- name: Clean coverage
|
- name: Clean coverage
|
||||||
@@ -352,7 +339,7 @@ jobs:
|
|||||||
# run integration tests with SMALL_TRANCHES
|
# run integration tests with SMALL_TRANCHES
|
||||||
########################
|
########################
|
||||||
integration-test:
|
integration-test:
|
||||||
name: itests
|
name: Run itests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: '!contains(github.event.pull_request.labels.*.name, ''no-itest'')'
|
if: '!contains(github.event.pull_request.labels.*.name, ''no-itest'')'
|
||||||
strategy:
|
strategy:
|
||||||
@@ -377,25 +364,28 @@ jobs:
|
|||||||
- name: bitcoind-postgres-nativesql-experiment
|
- name: bitcoind-postgres-nativesql-experiment
|
||||||
args: backend=bitcoind dbbackend=postgres nativesql=true tags=test_native_sql
|
args: backend=bitcoind dbbackend=postgres nativesql=true tags=test_native_sql
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: Git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: fetch and rebase on ${{ github.base_ref }}
|
- name: Clean up runner space
|
||||||
|
uses: ./.github/actions/cleanup-space
|
||||||
|
|
||||||
|
- name: Fetch and rebase on ${{ github.base_ref }}
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
uses: ./.github/actions/rebase
|
uses: ./.github/actions/rebase
|
||||||
|
|
||||||
- name: setup go ${{ env.GO_VERSION }}
|
- name: Setup go ${{ env.GO_VERSION }}
|
||||||
uses: ./.github/actions/setup-go
|
uses: ./.github/actions/setup-go
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.GO_VERSION }}'
|
go-version: '${{ env.GO_VERSION }}'
|
||||||
key-prefix: integration-test
|
key-prefix: integration-test
|
||||||
|
|
||||||
- name: install bitcoind
|
- name: Install bitcoind
|
||||||
run: ./scripts/install_bitcoind.sh $BITCOIN_VERSION
|
run: ./scripts/install_bitcoind.sh $BITCOIN_VERSION
|
||||||
|
|
||||||
- name: run ${{ matrix.name }}
|
- name: Run ${{ matrix.name }}
|
||||||
run: make itest-parallel tranches=${{ env.SMALL_TRANCHES }} ${{ matrix.args }} shuffleseed=${{ github.run_id }}${{ strategy.job-index }}
|
run: make itest-parallel tranches=${{ env.SMALL_TRANCHES }} ${{ matrix.args }} shuffleseed=${{ github.run_id }}${{ strategy.job-index }}
|
||||||
|
|
||||||
- name: Clean coverage
|
- name: Clean coverage
|
||||||
@@ -430,29 +420,29 @@ jobs:
|
|||||||
# run windows integration test
|
# run windows integration test
|
||||||
########################
|
########################
|
||||||
windows-integration-test:
|
windows-integration-test:
|
||||||
name: windows itest
|
name: Run windows itest
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
if: '!contains(github.event.pull_request.labels.*.name, ''no-itest'')'
|
if: '!contains(github.event.pull_request.labels.*.name, ''no-itest'')'
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: Git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: fetch and rebase on ${{ github.base_ref }}
|
- name: Fetch and rebase on ${{ github.base_ref }}
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
uses: ./.github/actions/rebase
|
uses: ./.github/actions/rebase
|
||||||
|
|
||||||
- name: setup go ${{ env.GO_VERSION }}
|
- name: Setup go ${{ env.GO_VERSION }}
|
||||||
uses: ./.github/actions/setup-go
|
uses: ./.github/actions/setup-go
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.GO_VERSION }}'
|
go-version: '${{ env.GO_VERSION }}'
|
||||||
key-prefix: integration-test
|
key-prefix: integration-test
|
||||||
|
|
||||||
- name: run itest
|
- name: Run itest
|
||||||
run: make itest-parallel tranches=${{ env.SMALL_TRANCHES }} windows=1 shuffleseed=${{ github.run_id }}
|
run: make itest-parallel tranches=${{ env.SMALL_TRANCHES }} windows=1 shuffleseed=${{ github.run_id }}
|
||||||
|
|
||||||
- name: kill any remaining lnd processes
|
- name: Kill any remaining lnd processes
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: taskkill /IM lnd-itest.exe /T /F
|
run: taskkill /IM lnd-itest.exe /T /F
|
||||||
@@ -474,26 +464,26 @@ jobs:
|
|||||||
# run macOS integration test
|
# run macOS integration test
|
||||||
########################
|
########################
|
||||||
macos-integration-test:
|
macos-integration-test:
|
||||||
name: macOS itest
|
name: Run macOS itest
|
||||||
runs-on: macos-14
|
runs-on: macos-14
|
||||||
if: '!contains(github.event.pull_request.labels.*.name, ''no-itest'')'
|
if: '!contains(github.event.pull_request.labels.*.name, ''no-itest'')'
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: Git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: fetch and rebase on ${{ github.base_ref }}
|
- name: Fetch and rebase on ${{ github.base_ref }}
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
uses: ./.github/actions/rebase
|
uses: ./.github/actions/rebase
|
||||||
|
|
||||||
- name: setup go ${{ env.GO_VERSION }}
|
- name: Setup go ${{ env.GO_VERSION }}
|
||||||
uses: ./.github/actions/setup-go
|
uses: ./.github/actions/setup-go
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.GO_VERSION }}'
|
go-version: '${{ env.GO_VERSION }}'
|
||||||
key-prefix: integration-test
|
key-prefix: integration-test
|
||||||
|
|
||||||
- name: run itest
|
- name: Run itest
|
||||||
run: make itest-parallel tranches=${{ env.SMALL_TRANCHES }} shuffleseed=${{ github.run_id }}
|
run: make itest-parallel tranches=${{ env.SMALL_TRANCHES }} shuffleseed=${{ github.run_id }}
|
||||||
|
|
||||||
- name: Zip log files on failure
|
- name: Zip log files on failure
|
||||||
@@ -513,7 +503,7 @@ jobs:
|
|||||||
# check pinned dependencies
|
# check pinned dependencies
|
||||||
########################
|
########################
|
||||||
dep-pin:
|
dep-pin:
|
||||||
name: check pinned dependencies
|
name: Check pinned dependencies
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
# Allow other tests in the matrix to continue if one fails.
|
# Allow other tests in the matrix to continue if one fails.
|
||||||
@@ -524,53 +514,95 @@ jobs:
|
|||||||
- github.com/golang/protobuf v1.5.3
|
- github.com/golang/protobuf v1.5.3
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: cleanup space
|
- name: Git checkout
|
||||||
run: rm -rf /opt/hostedtoolcache
|
|
||||||
|
|
||||||
- name: git checkout
|
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: ensure dependencies at correct version
|
- name: Clean up runner space
|
||||||
|
uses: ./.github/actions/cleanup-space
|
||||||
|
|
||||||
|
- name: Ensure dependencies at correct version
|
||||||
run: if ! grep -q "${{ matrix.pinned_dep }}" go.mod; then echo dependency ${{ matrix.pinned_dep }} should not be altered ; exit 1 ; fi
|
run: if ! grep -q "${{ matrix.pinned_dep }}" go.mod; then echo dependency ${{ matrix.pinned_dep }} should not be altered ; exit 1 ; fi
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# check PR updates release notes
|
# check PR updates release notes
|
||||||
########################
|
########################
|
||||||
milestone-check:
|
milestone-check:
|
||||||
name: check release notes updated
|
name: Check release notes updated
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: '!contains(github.event.pull_request.labels.*.name, ''no-changelog'')'
|
if: '!contains(github.event.pull_request.labels.*.name, ''no-changelog'')'
|
||||||
steps:
|
steps:
|
||||||
- name: cleanup space
|
- name: Git checkout
|
||||||
run: rm -rf /opt/hostedtoolcache
|
|
||||||
|
|
||||||
- name: git checkout
|
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: release notes check
|
- name: Clean up runner space
|
||||||
|
uses: ./.github/actions/cleanup-space
|
||||||
|
|
||||||
|
- name: Release notes check
|
||||||
run: scripts/check-release-notes.sh
|
run: scripts/check-release-notes.sh
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# Backwards Compatibility Test
|
# Backwards Compatibility Test
|
||||||
########################
|
########################
|
||||||
backwards-compatability-test:
|
backwards-compatibility-test:
|
||||||
name: backwards compatability test
|
name: Backwards compatibility test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: git checkout
|
- name: Git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: 🐳 Set up Docker Buildx
|
- name: 🐳 Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: 🛡️ backwards compatibility test
|
- name: 🛡️ Backwards compatibility test
|
||||||
run: make backwards-compat-test
|
run: make backwards-compat-test
|
||||||
|
|
||||||
|
#########################################
|
||||||
|
# Auto Cache Cleanup on Pull Requests
|
||||||
|
#########################################
|
||||||
|
auto-cleanup-cache:
|
||||||
|
name: Cache Cleanup
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
# This condition checks for pull requests from authors with write access.
|
||||||
|
if: >-
|
||||||
|
contains('OWNER, MEMBER, COLLABORATOR', github.event.pull_request.author_association)
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Delete caches older than 12 hours
|
||||||
|
continue-on-error: true
|
||||||
|
env:
|
||||||
|
# GITHUB_TOKEN is required for the gh CLI.
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
echo "Finding caches not used in the last 12 hours..."
|
||||||
|
|
||||||
|
# Get the current time and the cutoff time (12 hours ago) in Unix
|
||||||
|
# timestamp format.
|
||||||
|
cutoff_timestamp=$(date -d "12 hours ago" +%s)
|
||||||
|
|
||||||
|
# Use gh and jq to parse caches. Delete any cache last accessed
|
||||||
|
# before the cutoff time.
|
||||||
|
gh cache list --json key,lastAccessedAt | jq -r '.[] |
|
||||||
|
select(.lastAccessedAt != null) | "\(.lastAccessedAt) \(.key)"' |
|
||||||
|
while read -r last_accessed_at key; do
|
||||||
|
last_accessed_timestamp=$(date -d "$last_accessed_at" +%s)
|
||||||
|
|
||||||
|
if (( last_accessed_timestamp < cutoff_timestamp )); then
|
||||||
|
echo "Deleting old cache. Key: $key, Last Used: $last_accessed_at"
|
||||||
|
gh cache delete "$key"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# Notify about the completion of all coverage collecting jobs.
|
# Notify about the completion of all coverage collecting jobs.
|
||||||
finish:
|
finish:
|
||||||
if: ${{ always() }}
|
name: Send coverage report
|
||||||
|
if: ${{ !cancelled() }}
|
||||||
needs: [unit-test, basic-integration-test]
|
needs: [unit-test, basic-integration-test]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 5
|
||||||
steps:
|
steps:
|
||||||
- name: Send coverage
|
- name: Send coverage
|
||||||
uses: coverallsapp/github-action@v2
|
uses: coverallsapp/github-action@v2
|
||||||
|
15
.github/workflows/stats.yml
vendored
15
.github/workflows/stats.yml
vendored
@@ -4,12 +4,21 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
types: [opened]
|
types: [opened]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
# Required to post stats as comments.
|
||||||
|
actions: write
|
||||||
|
# Default permission for checking out code.
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stats:
|
stats:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
contents: read
|
# Check if the PR is from the base repo (not a fork). Only the
|
||||||
pull-requests: write
|
# collaborators have the permission to create a side branch from the base
|
||||||
|
# repo, so this implicitly restricts who can run this job.
|
||||||
|
if: github.event.pull_request.head.repo.fork == false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Run pull request stats
|
- name: Run pull request stats
|
||||||
uses: flowwer-dev/pull-request-stats@v2.11.0
|
uses: flowwer-dev/pull-request-stats@v2.11.0
|
||||||
|
Reference in New Issue
Block a user