Skip to content

Commit a60153b

Browse files
committed
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.
1 parent 9de8ad4 commit a60153b

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: LiT setup
2+
description: Prepare LiT workspace with Loop replaces, caches, and dependencies
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Clean up runner space
7+
uses: ./.github/actions/cleanup-space
8+
9+
- name: setup go
10+
uses: actions/setup-go@v5
11+
with:
12+
go-version: '~${{ env.GO_VERSION }}'
13+
14+
- name: Clone LiT repository
15+
uses: actions/checkout@v4
16+
with:
17+
repository: lightninglabs/lightning-terminal
18+
ref: ${{ env.LITD_ITEST_BRANCH }}
19+
path: lightning-terminal
20+
21+
- name: Update go.mod to use the local Loop repository
22+
working-directory: ./lightning-terminal
23+
run: |
24+
go mod edit -replace=github.com/lightninglabs/loop=../
25+
go mod edit -replace=github.com/lightninglabs/loop/looprpc=../looprpc
26+
go mod tidy
27+
shell: bash
28+
29+
- name: Cache Go modules
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
${{ env.GOCACHE }}
34+
${{ env.GOPATH }}/pkg/mod
35+
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-lit-${{ hashFiles('lightning-terminal/go.sum', 'go.sum') }}
36+
restore-keys: |
37+
${{ runner.os }}-go-${{ env.GO_VERSION }}-lit-
38+
39+
- name: Install yarn
40+
run: npm install -g yarn
41+
shell: bash
42+
43+
- name: setup nodejs
44+
uses: ./lightning-terminal/.github/actions/setup-node
45+
with:
46+
node-version: 16.x
47+
48+
- name: Cache yarn dependencies
49+
uses: actions/cache@v4
50+
with:
51+
path: |
52+
~/.cache/yarn
53+
lightning-terminal/app/node_modules
54+
key: ${{ runner.os }}-lit-node16-${{ hashFiles('lightning-terminal/app/yarn.lock') }}
55+
restore-keys: |
56+
${{ runner.os }}-lit-node16-
57+
58+
- name: install LiT app dependencies
59+
working-directory: ./lightning-terminal/app
60+
run: yarn
61+
shell: bash

.github/workflows/main.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ env:
2121
# If you change this value, please change it in the following files as well:
2222
# /Dockerfile
2323
GO_VERSION: 1.24.9
24+
LITD_ITEST_BRANCH: master
2425

2526
jobs:
2627
########################
@@ -143,3 +144,41 @@ jobs:
143144

144145
- name: run unit test with postgres
145146
run: make unit-postgres-race
147+
148+
########################
149+
# Run LiTd tests
150+
########################
151+
run-lit-itests:
152+
name: run LiT itests
153+
runs-on: ubuntu-latest
154+
continue-on-error: true
155+
156+
steps:
157+
- name: git checkout
158+
uses: actions/checkout@v4
159+
160+
- name: Prepare LiT workspace
161+
uses: ./.github/actions/lit-setup
162+
163+
- name: Run LiT itests
164+
working-directory: ./lightning-terminal
165+
run: make itest-no-backward-compat
166+
167+
########################
168+
# Run LiTd unit tests
169+
########################
170+
run-lit-unit:
171+
name: run LiT unit tests
172+
runs-on: ubuntu-latest
173+
continue-on-error: true
174+
175+
steps:
176+
- name: git checkout
177+
uses: actions/checkout@v4
178+
179+
- name: Prepare LiT workspace
180+
uses: ./.github/actions/lit-setup
181+
182+
- name: Run LiT unit tests
183+
working-directory: ./lightning-terminal
184+
run: make unit

0 commit comments

Comments
 (0)