From 3dd747460a1cc2f511ef68bb9c86566a259781bb Mon Sep 17 00:00:00 2001 From: ffranr Date: Mon, 24 Nov 2025 16:02:29 +0000 Subject: [PATCH 1/3] ci: add LiT tests workflow to GitHub Actions Add a new workflow to run tests for the LiT repository. This includes setting up dependencies, cloning the repository, and updating the `go.mod` file to use local Loop modules. --- .github/actions/lit-setup/action.yml | 58 ++++++++++++++++++++++++++++ .github/workflows/main.yml | 39 +++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 .github/actions/lit-setup/action.yml diff --git a/.github/actions/lit-setup/action.yml b/.github/actions/lit-setup/action.yml new file mode 100644 index 00000000..6bd88474 --- /dev/null +++ b/.github/actions/lit-setup/action.yml @@ -0,0 +1,58 @@ +name: LiT setup +description: Prepare LiT workspace with Loop replaces, caches, and dependencies +runs: + using: composite + steps: + - name: setup go + uses: actions/setup-go@v5 + with: + go-version: '~${{ env.GO_VERSION }}' + + - name: Clone LiT repository + uses: actions/checkout@v4 + with: + repository: lightninglabs/lightning-terminal + ref: ${{ env.LITD_ITEST_BRANCH }} + path: lightning-terminal + + - name: Update go.mod to use the local Loop repository + working-directory: ./lightning-terminal + run: | + go mod edit -replace=github.com/lightninglabs/loop=../ + go mod edit -replace=github.com/lightninglabs/loop/looprpc=../looprpc + go mod tidy + shell: bash + + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: | + ${{ env.GOCACHE }} + ${{ env.GOPATH }}/pkg/mod + key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-lit-${{ hashFiles('lightning-terminal/go.sum', 'go.sum') }} + restore-keys: | + ${{ runner.os }}-go-${{ env.GO_VERSION }}-lit- + + - name: Install yarn + run: npm install -g yarn + shell: bash + + - name: setup nodejs + uses: ./lightning-terminal/.github/actions/setup-node + with: + node-version: 16.x + + - name: Cache yarn dependencies + uses: actions/cache@v4 + with: + path: | + ~/.cache/yarn + lightning-terminal/app/node_modules + key: ${{ runner.os }}-lit-node16-${{ hashFiles('lightning-terminal/app/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-lit-node16- + + - name: install LiT app dependencies + working-directory: ./lightning-terminal/app + run: yarn + shell: bash diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e2ad2bae..911b422a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,6 +21,7 @@ env: # If you change this value, please change it in the following files as well: # /Dockerfile GO_VERSION: 1.24.9 + LITD_ITEST_BRANCH: master jobs: ######################## @@ -143,3 +144,41 @@ jobs: - name: run unit test with postgres run: make unit-postgres-race + + ######################## + # Run LiTd tests + ######################## + run-lit-itests: + name: run LiT itests + runs-on: ubuntu-latest + continue-on-error: true + + steps: + - name: git checkout + uses: actions/checkout@v4 + + - name: Prepare LiT workspace + uses: ./.github/actions/lit-setup + + - name: Run LiT itests + working-directory: ./lightning-terminal + run: make itest-no-backward-compat icase='terminal .*' + + ######################## + # Run LiTd unit tests + ######################## + run-lit-unit: + name: run LiT unit tests + runs-on: ubuntu-latest + continue-on-error: true + + steps: + - name: git checkout + uses: actions/checkout@v4 + + - name: Prepare LiT workspace + uses: ./.github/actions/lit-setup + + - name: Run LiT unit tests + working-directory: ./lightning-terminal + run: make unit From d00bfab6433077247e916096a93dccbd1827781e Mon Sep 17 00:00:00 2001 From: ffranr Date: Tue, 25 Nov 2025 15:18:54 +0000 Subject: [PATCH 2/3] ci: bump actions/checkout to v4 --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 911b422a..20bde8b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest steps: - name: git checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: setup go ${{ env.GO_VERSION }} uses: actions/setup-go@v2 @@ -53,7 +53,7 @@ jobs: runs-on: ubuntu-latest steps: - name: git checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: setup go ${{ env.GO_VERSION }} uses: actions/setup-go@v2 @@ -71,7 +71,7 @@ jobs: runs-on: ubuntu-latest steps: - name: git checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: setup go ${{ env.GO_VERSION }} uses: actions/setup-go@v2 @@ -89,7 +89,7 @@ jobs: runs-on: ubuntu-latest steps: - name: git checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -112,7 +112,7 @@ jobs: runs-on: ubuntu-latest steps: - name: git checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -132,7 +132,7 @@ jobs: runs-on: ubuntu-latest steps: - name: git checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: setup go ${{ env.GO_VERSION }} uses: actions/setup-go@v5 From d56fb5b5421d6740d81a3eae5fa6dfb51d326139 Mon Sep 17 00:00:00 2001 From: ffranr Date: Tue, 25 Nov 2025 15:23:20 +0000 Subject: [PATCH 3/3] ci: split out postgres unit-test run for parallelism --- .github/workflows/main.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 20bde8b2..c303198b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -125,10 +125,10 @@ jobs: run: make docs-check ######################## - # run unit tests + # run unit-test sqlite3 race ######################## unit-test: - name: run unit tests + name: run unit-test sqlite3 race runs-on: ubuntu-latest steps: - name: git checkout @@ -139,10 +139,25 @@ jobs: with: go-version: '~${{ env.GO_VERSION }}' - - name: run unit tests + - name: run unit-test sqlite3 race run: make unit-race - - name: run unit test with postgres + ######################## + # run unit-test postgres race + ######################## + unit-test-postgres: + name: run unit-test postgres race + runs-on: ubuntu-latest + steps: + - name: git checkout + uses: actions/checkout@v4 + + - name: setup go ${{ env.GO_VERSION }} + uses: actions/setup-go@v5 + with: + go-version: '~${{ env.GO_VERSION }}' + + - name: run unit-test postgres race run: make unit-postgres-race ########################