From 8d2a3ce8acf69a2f40c20d3bc14ae2616c13c652 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Thu, 23 Jul 2020 15:06:04 +0200 Subject: [PATCH 1/2] github: add mobile compilation to GitHub workflow --- .github/workflows/main.yml | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e947d771..c8a4e9aa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -158,6 +158,50 @@ jobs: - name: build release for architecture run: make release sys=${{ matrix.build_sys }} + ######################## + # mobile compilation + ######################## + mobile-compile: + name: mobile compilation + 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: + go-version: '~${{ env.GO_VERSION }}' + + - name: download cache + uses: actions/cache@v1 + with: + path: /home/runner/work/download_cache + key: lnd-${{ runner.os }}-download-${{ hashFiles('**/install_travis_proto.sh') }} + restore-keys: | + lnd-${{ runner.os }}-download-${{ hashFiles('**/install_travis_proto.sh') }} + lnd-${{ runner.os }}-download- + + - name: install protoc and protobuf libraries + run: ./scripts/install_travis_proto.sh + + - name: build mobile RPC bindings + run: make mobile-rpc + + - name: build mobile specific code + run: go build --tags="mobile" ./mobile + ######################## # run unit tests ######################## From 17b8b7ea0cf44384a586eb56db182b5d3a10c133 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Thu, 23 Jul 2020 15:06:05 +0200 Subject: [PATCH 2/2] github+travis: split CI tasks between Travis and GitHub To free up build in Travis, we decided to run the non-flaky parts of the CI pipeline in GitHub Workflows/Actions only. The integration tests on the other hand are removed from GitHub because individual actions cannot be restarted there which caused us to restart the whole workflow if one test was flaky. This split should give us the best of both worlds: Fast run of small checks, linting and unit tests with an easy overview of what failed in the PR directly. And more free build slots on Travis to do more advanced integration tests on other architectures and/or operating systems. And the option to restart a single flaky integration test on Travis. --- .github/workflows/main.yml | 60 -------------------------------------- .travis.yml | 41 +++++++++----------------- 2 files changed, 13 insertions(+), 88 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8a4e9aa..a68c0289 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -255,63 +255,3 @@ jobs: with: path-to-profile: coverage.txt parallel: true - - ######################## - # run integration tests - ######################## - integration-test: - name: run integration tests - runs-on: ubuntu-latest - strategy: - # Allow other tests in the matrix to continue if one fails. - fail-fast: false - matrix: - backend: - - btcd - - bitcoind - - neutrino - 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: - go-version: '~${{ env.GO_VERSION }}' - - - name: bitcoin cache - uses: actions/cache@v1 - with: - path: /home/runner/bitcoin/bitcoin-${{ env.BITCOIN_VERSION }}/bin - key: lnd-${{ runner.os }}-bitcoin-${{ env.BITCOIN_VERSION }} - restore-keys: | - lnd-${{ runner.os }}-bitcoin-${{ env.BITCOIN_VERSION }} - - - name: install bitcoind - run: bash ./scripts/install_bitcoind.sh - if: matrix.backend == 'bitcoind' - - - name: ${{ matrix.backend }} integration - run: make itest backend=${{ matrix.backend }} - - - name: package logfiles - run: tar -zcvf itest-logs-${{ matrix.backend }}.tar.gz lntest/itest/*.log - if: failure() - - - name: upload logfiles - uses: actions/upload-artifact@v1 - if: failure() - with: - name: itest-logs-${{ matrix.backend }} - path: itest-logs-${{ matrix.backend }}.tar.gz diff --git a/.travis.yml b/.travis.yml index a3a1c0bc..0706e70a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,37 +26,22 @@ env: sudo: required -addons: - apt: - packages: - - clang-format - -before_script: - - bash ./scripts/install_travis_proto.sh - - bash ./scripts/install_bitcoind.sh - jobs: include: - - stage: Build - script: - - make rpc-check - - make unit pkg=... case=_NONE_ - - make lint workers=1 - - make btcd - - make release sys=windows-amd64 - - make mobile-rpc - - go build --tags="mobile" ./mobile - - stage: Test - script: make travis-cover - name: Unit Cover - - script: make travis-race - name: Unit Race - - script: make itest + - stage: Integration Test name: Btcd Integration - - script: make itest backend=bitcoind - name: Bitcoind Integration - - script: make itest backend=neutrino - name: Neutrino Integration + script: + - make itest + + - name: Bitcoind Integration + script: + - bash ./scripts/install_bitcoind.sh + - make itest backend=bitcoind + + - name: Neutrino Integration + script: + - make itest backend=neutrino + after_script: - LOG_FILES=./lntest/itest/*.log