2020-04-24 11:14:48 +02:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "master"
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- "*"
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
env:
|
|
|
|
# go needs absolute directories, using the $HOME variable doesn't work here.
|
|
|
|
GOCACHE: /home/runner/work/go/pkg/build
|
|
|
|
GOPATH: /home/runner/work/go
|
2020-10-08 14:58:49 +02:00
|
|
|
BITCOIN_VERSION: 0.20.1
|
2020-12-12 11:26:00 +01:00
|
|
|
|
|
|
|
# If you change this value, please change it in the following files as well:
|
|
|
|
# /.travis.yml
|
|
|
|
# /Dockerfile
|
|
|
|
# /dev.Dockerfile
|
2021-01-08 10:40:17 +01:00
|
|
|
# /make/builder.Dockerfile
|
2020-12-12 11:26:00 +01:00
|
|
|
# /.github/workflows/release.yml
|
2021-02-16 16:18:35 -08:00
|
|
|
GO_VERSION: 1.16.3
|
2020-04-24 11:14:48 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
########################
|
2021-01-15 13:44:56 +01:00
|
|
|
# RPC and mobile compilation check
|
2020-04-24 11:14:48 +02:00
|
|
|
########################
|
|
|
|
rpc-check:
|
2021-01-15 13:44:56 +01:00
|
|
|
name: RPC and mobile compilation check
|
2020-04-24 11:14:48 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: git checkout
|
2020-05-18 10:58:12 +02:00
|
|
|
uses: actions/checkout@v2
|
2020-04-24 11:14:48 +02:00
|
|
|
|
|
|
|
- name: go cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: /home/runner/work/go
|
|
|
|
key: lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-
|
|
|
|
lnd-${{ runner.os }}-go-
|
|
|
|
|
|
|
|
- name: setup go ${{ env.GO_VERSION }}
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2021-02-11 15:49:22 -08:00
|
|
|
go-version: '${{ env.GO_VERSION }}'
|
2020-04-24 11:14:48 +02:00
|
|
|
|
|
|
|
- name: run check
|
|
|
|
run: make rpc-check
|
2021-08-03 13:37:58 +02:00
|
|
|
|
|
|
|
- name: run JSON/WASM stub compilation check
|
|
|
|
run: make rpc-js-compile
|
|
|
|
|
2021-01-15 13:44:56 +01:00
|
|
|
- name: build mobile RPC bindings
|
|
|
|
run: make mobile-rpc
|
|
|
|
|
|
|
|
- name: build mobile specific code
|
|
|
|
run: go build --tags="mobile" ./mobile
|
2020-04-24 11:14:48 +02:00
|
|
|
|
|
|
|
########################
|
2020-12-08 13:36:48 -08:00
|
|
|
# check commits
|
2020-04-24 11:14:48 +02:00
|
|
|
########################
|
2020-12-08 13:36:48 -08:00
|
|
|
check-commits:
|
|
|
|
name: check commits
|
2020-04-24 11:14:48 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: git checkout
|
2020-05-18 10:58:12 +02:00
|
|
|
uses: actions/checkout@v2
|
2020-12-08 13:36:48 -08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-04-24 11:14:48 +02:00
|
|
|
|
|
|
|
- name: go cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: /home/runner/work/go
|
|
|
|
key: lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-
|
|
|
|
lnd-${{ runner.os }}-go-
|
|
|
|
|
|
|
|
- name: setup go ${{ env.GO_VERSION }}
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2021-02-11 15:49:22 -08:00
|
|
|
go-version: '${{ env.GO_VERSION }}'
|
2020-04-24 11:14:48 +02:00
|
|
|
|
2020-12-08 13:36:48 -08:00
|
|
|
- name: fetch and rebase on master
|
|
|
|
run: |
|
|
|
|
git remote add upstream https://github.com/lightningnetwork/lnd
|
|
|
|
git fetch upstream
|
|
|
|
export GIT_COMMITTER_EMAIL="lnd-ci@example.com"
|
|
|
|
export GIT_COMMITTER_NAME="LND CI"
|
|
|
|
git rebase upstream/master
|
|
|
|
|
|
|
|
- name: check commits
|
|
|
|
run: scripts/check-each-commit.sh upstream/master
|
2020-04-24 11:14:48 +02:00
|
|
|
|
|
|
|
########################
|
|
|
|
# lint code
|
|
|
|
########################
|
|
|
|
lint:
|
|
|
|
name: lint code
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: git checkout
|
2020-05-18 10:58:12 +02:00
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Fetch all history for linter
|
|
|
|
run: git fetch --prune --unshallow
|
2020-04-24 11:14:48 +02:00
|
|
|
|
|
|
|
- name: go cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: /home/runner/work/go
|
|
|
|
key: lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-
|
|
|
|
lnd-${{ runner.os }}-go-
|
|
|
|
|
|
|
|
- name: setup go ${{ env.GO_VERSION }}
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2021-02-11 15:49:22 -08:00
|
|
|
go-version: '${{ env.GO_VERSION }}'
|
2020-04-24 11:14:48 +02:00
|
|
|
|
|
|
|
- name: lint
|
2021-07-27 13:00:00 +02:00
|
|
|
run: GOGC=50 make lint
|
2020-04-24 11:14:48 +02:00
|
|
|
|
|
|
|
########################
|
|
|
|
# cross compilation
|
|
|
|
########################
|
|
|
|
cross-compile:
|
|
|
|
name: cross compilation
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: git checkout
|
2020-05-18 10:58:12 +02:00
|
|
|
uses: actions/checkout@v2
|
2020-04-24 11:14:48 +02:00
|
|
|
|
|
|
|
- name: go cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: /home/runner/work/go
|
|
|
|
key: lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-
|
|
|
|
lnd-${{ runner.os }}-go-
|
|
|
|
|
|
|
|
- name: setup go ${{ env.GO_VERSION }}
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2021-02-11 15:49:22 -08:00
|
|
|
go-version: '${{ env.GO_VERSION }}'
|
2020-04-24 11:14:48 +02:00
|
|
|
|
2020-11-09 10:21:32 +01:00
|
|
|
- name: build release for all architectures
|
|
|
|
run: make release
|
2020-04-24 11:14:48 +02:00
|
|
|
|
2020-10-08 09:10:59 +02:00
|
|
|
########################
|
|
|
|
# sample configuration check
|
|
|
|
########################
|
|
|
|
sample-conf-check:
|
|
|
|
name: sample configuration check
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: git checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: go cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: /home/runner/work/go
|
|
|
|
key: lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-
|
|
|
|
lnd-${{ runner.os }}-go-
|
|
|
|
|
|
|
|
- name: setup go ${{ env.GO_VERSION }}
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2021-02-11 15:49:22 -08:00
|
|
|
go-version: '${{ env.GO_VERSION }}'
|
2020-10-08 09:10:59 +02:00
|
|
|
|
|
|
|
- name: check all command line flags exist in sample-lnd.conf file
|
|
|
|
run: make sample-conf-check
|
|
|
|
|
2020-04-24 11:14:48 +02:00
|
|
|
########################
|
|
|
|
# run unit tests
|
|
|
|
########################
|
|
|
|
unit-test:
|
|
|
|
name: run unit tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
# Allow other tests in the matrix to continue if one fails.
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
unit_type:
|
|
|
|
- btcd unit-cover
|
2020-09-04 15:55:52 +02:00
|
|
|
- unit tags=kvdb_etcd
|
2020-04-24 11:14:48 +02:00
|
|
|
- travis-race
|
|
|
|
steps:
|
|
|
|
- name: git checkout
|
2020-05-18 10:58:12 +02:00
|
|
|
uses: actions/checkout@v2
|
2020-04-24 11:14:48 +02:00
|
|
|
|
|
|
|
- name: go cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: /home/runner/work/go
|
|
|
|
key: lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-
|
|
|
|
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-
|
|
|
|
lnd-${{ runner.os }}-go-
|
|
|
|
|
|
|
|
- name: setup go ${{ env.GO_VERSION }}
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2021-02-11 15:49:22 -08:00
|
|
|
go-version: '${{ env.GO_VERSION }}'
|
2020-04-24 11:14:48 +02:00
|
|
|
|
|
|
|
- name: install bitcoind
|
|
|
|
run: ./scripts/install_bitcoind.sh
|
|
|
|
|
|
|
|
- name: run ${{ matrix.unit_type }}
|
|
|
|
run: make ${{ matrix.unit_type }}
|
|
|
|
|
|
|
|
- name: Send coverage
|
|
|
|
uses: shogo82148/actions-goveralls@v1
|
|
|
|
if: matrix.unit_type == 'btcd unit-cover'
|
|
|
|
with:
|
|
|
|
path-to-profile: coverage.txt
|
|
|
|
parallel: true
|
2020-12-15 21:17:11 +02:00
|
|
|
|
|
|
|
########################
|
|
|
|
# check pinned dependencies
|
|
|
|
########################
|
|
|
|
dep-pin:
|
|
|
|
name: check pinned dependencies
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
# Allow other tests in the matrix to continue if one fails.
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
pinned_dep:
|
2021-07-27 12:59:58 +02:00
|
|
|
- google.golang.org/grpc v1.38.0
|
|
|
|
- github.com/golang/protobuf v1.5.2
|
2020-12-15 21:17:11 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: git checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: ensure dependences 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
|
2021-07-14 16:54:09 -07:00
|
|
|
|
|
|
|
########################
|
|
|
|
# check PR updates release notes
|
|
|
|
########################
|
|
|
|
milestone-check:
|
|
|
|
name: check release notes updated
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: git checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: release notes check
|
|
|
|
run: scripts/check-release-notes.sh
|