Skip to content

Commit 2cdf084

Browse files
authored
Merge pull request #1050 from ffranr/add-ci-lit-test
Add LiT CI job and runner cleanup action
2 parents 83628d7 + d56fb5b commit 2cdf084

File tree

2 files changed

+122
-10
lines changed

2 files changed

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

.github/workflows/main.yml

Lines changed: 64 additions & 10 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
########################
@@ -31,7 +32,7 @@ jobs:
3132
runs-on: ubuntu-latest
3233
steps:
3334
- name: git checkout
34-
uses: actions/checkout@v2
35+
uses: actions/checkout@v4
3536

3637
- name: setup go ${{ env.GO_VERSION }}
3738
uses: actions/setup-go@v2
@@ -52,7 +53,7 @@ jobs:
5253
runs-on: ubuntu-latest
5354
steps:
5455
- name: git checkout
55-
uses: actions/checkout@v2
56+
uses: actions/checkout@v4
5657

5758
- name: setup go ${{ env.GO_VERSION }}
5859
uses: actions/setup-go@v2
@@ -70,7 +71,7 @@ jobs:
7071
runs-on: ubuntu-latest
7172
steps:
7273
- name: git checkout
73-
uses: actions/checkout@v2
74+
uses: actions/checkout@v4
7475

7576
- name: setup go ${{ env.GO_VERSION }}
7677
uses: actions/setup-go@v2
@@ -88,7 +89,7 @@ jobs:
8889
runs-on: ubuntu-latest
8990
steps:
9091
- name: git checkout
91-
uses: actions/checkout@v2
92+
uses: actions/checkout@v4
9293
with:
9394
fetch-depth: 0
9495

@@ -111,7 +112,7 @@ jobs:
111112
runs-on: ubuntu-latest
112113
steps:
113114
- name: git checkout
114-
uses: actions/checkout@v2
115+
uses: actions/checkout@v4
115116
with:
116117
fetch-depth: 0
117118

@@ -124,22 +125,75 @@ jobs:
124125
run: make docs-check
125126

126127
########################
127-
# run unit tests
128+
# run unit-test sqlite3 race
128129
########################
129130
unit-test:
130-
name: run unit tests
131+
name: run unit-test sqlite3 race
131132
runs-on: ubuntu-latest
132133
steps:
133134
- name: git checkout
134-
uses: actions/checkout@v2
135+
uses: actions/checkout@v4
135136

136137
- name: setup go ${{ env.GO_VERSION }}
137138
uses: actions/setup-go@v5
138139
with:
139140
go-version: '~${{ env.GO_VERSION }}'
140141

141-
- name: run unit tests
142+
- name: run unit-test sqlite3 race
142143
run: make unit-race
143144

144-
- name: run unit test with postgres
145+
########################
146+
# run unit-test postgres race
147+
########################
148+
unit-test-postgres:
149+
name: run unit-test postgres race
150+
runs-on: ubuntu-latest
151+
steps:
152+
- name: git checkout
153+
uses: actions/checkout@v4
154+
155+
- name: setup go ${{ env.GO_VERSION }}
156+
uses: actions/setup-go@v5
157+
with:
158+
go-version: '~${{ env.GO_VERSION }}'
159+
160+
- name: run unit-test postgres race
145161
run: make unit-postgres-race
162+
163+
########################
164+
# Run LiTd tests
165+
########################
166+
run-lit-itests:
167+
name: run LiT itests
168+
runs-on: ubuntu-latest
169+
continue-on-error: true
170+
171+
steps:
172+
- name: git checkout
173+
uses: actions/checkout@v4
174+
175+
- name: Prepare LiT workspace
176+
uses: ./.github/actions/lit-setup
177+
178+
- name: Run LiT itests
179+
working-directory: ./lightning-terminal
180+
run: make itest-no-backward-compat icase='terminal .*'
181+
182+
########################
183+
# Run LiTd unit tests
184+
########################
185+
run-lit-unit:
186+
name: run LiT unit tests
187+
runs-on: ubuntu-latest
188+
continue-on-error: true
189+
190+
steps:
191+
- name: git checkout
192+
uses: actions/checkout@v4
193+
194+
- name: Prepare LiT workspace
195+
uses: ./.github/actions/lit-setup
196+
197+
- name: Run LiT unit tests
198+
working-directory: ./lightning-terminal
199+
run: make unit

0 commit comments

Comments
 (0)