Skip to content

Commit

Permalink
Merge pull request #7254 from yyforyongyu/fix-tools
Browse files Browse the repository at this point in the history
tools: fix docker version
  • Loading branch information
Roasbeef authored Dec 15, 2022
2 parents 8a18824 + 3ca7e30 commit a347e40
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 181 deletions.
28 changes: 28 additions & 0 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# A resuable workflow that's used to setup the go enviroment and cache.
name: Setup go enviroment

runs:
using: "composite"

steps:
- name: setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v3
with:
go-version: '${{ env.GO_VERSION }}'

- name: go cache
uses: actions/cache@v3
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
~\AppData\Local\go-build
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ env.GO_VERSION }}-
224 changes: 44 additions & 180 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,6 @@ env:
GO_VERSION: 1.19.2

jobs:
########################
# format code
########################
fmt-check:
name: check code format
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3

- name: setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v3
with:
go-version: '${{ env.GO_VERSION }}'

- name: fmt
run: make fmt-check

########################
# RPC and mobile compilation check
########################
Expand All @@ -58,23 +40,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- 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:
go-version: '${{ env.GO_VERSION }}'
- id: setup
name: Setup go env
uses: ./.github/actions/setup-go

- name: run check
run: make rpc-check
Expand All @@ -97,25 +67,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- 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:
go-version: '${{ env.GO_VERSION }}'
- id: setup
name: Setup go env
uses: ./.github/actions/setup-go

- name: fetch and rebase on ${{ github.base_ref }}
run: |
Expand All @@ -136,26 +94,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Fetch all history for linter
run: git fetch --prune --unshallow
- id: setup
name: Setup go env
uses: ./.github/actions/setup-go

- 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:
go-version: '${{ env.GO_VERSION }}'
- name: check code format
run: make fmt-check

- name: lint
run: GOGC=50 make lint
Expand All @@ -168,23 +116,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- 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:
go-version: '${{ env.GO_VERSION }}'
- id: setup
name: Setup go env
uses: ./.github/actions/setup-go

- name: build release for all architectures
run: make release
Expand All @@ -197,23 +133,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- 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:
go-version: '${{ env.GO_VERSION }}'
- id: setup
name: Setup go env
uses: ./.github/actions/setup-go

- name: check all command line flags exist in sample-lnd.conf file
run: make sample-conf-check
Expand All @@ -235,23 +159,11 @@ jobs:
- btcd unit-race
steps:
- name: git checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- 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:
go-version: '${{ env.GO_VERSION }}'
- id: setup
name: Setup go env
uses: ./.github/actions/setup-go

- name: install bitcoind
run: ./scripts/install_bitcoind.sh
Expand Down Expand Up @@ -293,23 +205,11 @@ jobs:
args: backend=neutrino
steps:
- name: git checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- 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:
go-version: '${{ env.GO_VERSION }}'
- id: setup
name: Setup go env
uses: ./.github/actions/setup-go

- name: install bitcoind
run: ./scripts/install_bitcoind.sh
Expand Down Expand Up @@ -341,23 +241,11 @@ jobs:
GOPATH: ${{ github.workspace }}/go
steps:
- name: git checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: go cache
uses: actions/cache@v1
with:
path: ${{ env.GOPATH }}
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:
go-version: '${{ env.GO_VERSION }}'
- id: setup
name: Setup go env
uses: ./.github/actions/setup-go

- name: run itest
run: make itest-parallel windows=1 tranches=2 parallel=2
Expand Down Expand Up @@ -403,21 +291,9 @@ jobs:
- name: git checkout
uses: actions/checkout@v3

- 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@v3
with:
go-version: '${{ env.GO_VERSION }}'
- id: setup
name: Setup go env
uses: ./.github/actions/setup-go

- name: install bitcoind
run: ./scripts/install_bitcoind.sh
Expand Down Expand Up @@ -451,21 +327,9 @@ jobs:
- name: git checkout
uses: actions/checkout@v3

- name: go cache
uses: actions/cache@v1
with:
path: ${{ env.GOPATH }}
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@v3
with:
go-version: '${{ env.GO_VERSION }}'
- id: setup
name: Setup go env
uses: ./.github/actions/setup-go

- name: run new itest
run: make itest-parallel temptest=true windows=1 tranches=2 parallel=2
Expand Down Expand Up @@ -500,7 +364,7 @@ jobs:

steps:
- name: git checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- 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
Expand All @@ -513,7 +377,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: release notes check
run: scripts/check-release-notes.sh
3 changes: 3 additions & 0 deletions docs/release-notes/release-notes-0.16.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ certain large transactions](https://github.com/lightningnetwork/lnd/pull/7100).
check](https://github.com/lightningnetwork/lnd/pull/7114) for all non-PR
events.

* Fixed docker image version used in
[`tools`](https://github.com/lightningnetwork/lnd/pull/7254).

### Integration test

The `lntest` has been
Expand Down
2 changes: 1 addition & 1 deletion tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19.2-buster
FROM golang:1.19

RUN apt-get update && apt-get install -y git
ENV GOCACHE=/tmp/build/.cache
Expand Down

0 comments on commit a347e40

Please sign in to comment.