diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml new file mode 100644 index 0000000000..1db347509c --- /dev/null +++ b/.github/actions/setup-go/action.yml @@ -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 }}- diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3c3009d046..5614a387a1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 ######################## @@ -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 @@ -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: | @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/docs/release-notes/release-notes-0.16.0.md b/docs/release-notes/release-notes-0.16.0.md index 991e07e20a..3952878e7e 100644 --- a/docs/release-notes/release-notes-0.16.0.md +++ b/docs/release-notes/release-notes-0.16.0.md @@ -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 diff --git a/tools/Dockerfile b/tools/Dockerfile index 2707e0f672..4da8390c49 100644 --- a/tools/Dockerfile +++ b/tools/Dockerfile @@ -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