Skip to content

Commit

Permalink
GitHub+Travis: move itests to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed Oct 5, 2021
1 parent c89637a commit 134be24
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 60 deletions.
91 changes: 90 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,95 @@ jobs:
path-to-profile: coverage.txt
parallel: true

########################
# run integration tests
########################
integration-test:
name: run itests
runs-on: ubuntu-latest
strategy:
# Allow other tests in the matrix to continue if one fails.
fail-fast: false
matrix:
integration_type:
- backend=btcd
- backend=bitcoind
- backend="bitcoind notxindex"
- backend=bitcoind dbbackend=etcd
- backend=bitcoind dbbackend=postgres
- backend=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: install bitcoind
run: ./scripts/install_bitcoind.sh

- name: run ${{ matrix.unit_type }}
run: make itest-parallel ${{ matrix.unit_type }}

- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: logs
path: lntest/itest/**/*.log
retention-days: 5

########################
# run windows integration test
########################
windows-integration-test:
name: run windows itest
runs-on: windows-latest
env:
GOCACHE: ${{ github.workspace }}/go/pkg/build
GOPATH: ${{ github.workspace }}/go
steps:
- name: git checkout
uses: actions/checkout@v2

- 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 }}'

- name: run itest
run: make itest-parallel windows=1 tranches=2 parallel=2

- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: logs
path: lntest/itest/**/*.log
retention-days: 5

########################
# check pinned dependencies
########################
Expand All @@ -260,7 +349,7 @@ jobs:
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
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
Expand Down
63 changes: 4 additions & 59 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,71 +47,16 @@ jobs:
- GOGC=30 make lint

- stage: Integration Test
name: Btcd Integration
script:
- make itest-parallel

- name: Bitcoind Integration (txindex enabled)
script:
- bash ./scripts/install_bitcoind.sh
- make itest-parallel backend=bitcoind

- name: Bitcoind Integration with etcd (txindex enabled)
script:
- bash ./scripts/install_bitcoind.sh
- make itest-parallel backend=bitcoind dbbackend=etcd

- name: Bitcoind Integration with postgres (txindex enabled)
script:
- bash ./scripts/install_bitcoind.sh
- make itest-parallel backend=bitcoind dbbackend=postgres POSTGRES_START_DELAY=10

- name: Bitcoind Integration (txindex disabled)
script:
- bash ./scripts/install_bitcoind.sh
- make itest-parallel backend="bitcoind notxindex"

- name: Neutrino Integration
script:
- make itest-parallel backend=neutrino

- name: Bitcoind Integration ARM
name: Bitcoind Integration ARM
script:
- bash ./scripts/install_bitcoind.sh
- GOARM=7 GOARCH=arm GOOS=linux make itest-parallel backend=bitcoind tranches=2 parallel=2
arch: arm64
services:
- docker

- name: Btcd Integration Windows
script:
# The windows VM seems to be slower than the other Travis VMs. We only
# run 2 test suites in parallel instead of the default 4.
- make itest-parallel windows=1 tranches=2 parallel=2
os: windows
before_install:
- choco upgrade --no-progress -y make netcat curl findutils
- export MAKE=mingw32-make
after_failure:
- |-
case $TRAVIS_OS_NAME in
windows)
echo "Uploading to termbin.com..."
LOG_FILES=$(find ./lntest/itest -name '*.log')
for f in $LOG_FILES; do echo -n $f; cat $f | nc termbin.com 9999 | xargs -r0 printf ' uploaded to %s'; done
;;
esac
after_failure:
- |-
case $TRAVIS_OS_NAME in
windows)
# Needs other commands, see after_script of the Windows build
;;
*)
LOG_FILES=$(find ./lntest/itest -name '*.log')
echo "Uploading to termbin.com..." && for f in $LOG_FILES; do echo -n $f; cat $f | nc termbin.com 9999 | xargs -r0 printf ' uploaded to %s'; done
echo "Uploading to file.io..." && tar -zcvO $LOG_FILES | curl -s -F 'file=@-;filename=logs.tar.gz' https://file.io | xargs -r0 printf 'logs.tar.gz uploaded to %s\n'
;;
esac
LOG_FILES=$(find ./lntest/itest -name '*.log')
echo "Uploading to termbin.com..." && for f in $LOG_FILES; do echo -n $f; cat $f | nc termbin.com 9999 | xargs -r0 printf ' uploaded to %s'; done
echo "Uploading to file.io..." && tar -zcvO $LOG_FILES | curl -s -F 'file=@-;filename=logs.tar.gz' https://file.io | xargs -r0 printf 'logs.tar.gz uploaded to %s\n'
3 changes: 3 additions & 0 deletions docs/release-notes/release-notes-0.14.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ you.
1.17.1](https://github.com/lightningnetwork/lnd/pull/5650). All build tags have
been updated accordingly to comply with the new Go 1.17.1 requirements.

* [All integration tests (except the ARM itests) were moved from Travis CI to
GitHub Actions](https://github.com/lightningnetwork/lnd/pull/5811).

## Documentation

* [Outdated warning about unsupported pruning was replaced with clarification that LND **does**
Expand Down

0 comments on commit 134be24

Please sign in to comment.