1- name : CI
2-
3- on :
4- push :
5- branches :
6- - master
7- pull_request :
8- types : [opened, synchronize, reopened]
9-
10- env :
11- SLOW_MACHINE : 1
12-
13- jobs :
14- unit-tests :
15- runs-on : ubuntu-latest
16-
17- steps :
18- - name : Checkout code
19- uses : actions/checkout@v3
20-
21- - name : Set up Go
22- uses : actions/setup-go@v4
23- id : setup-go
24- with :
25- go-version-file : " go.mod"
26-
27- - name : Download Go modules
28- shell : bash
29- if : ${{ steps.setup-go.outputs.cache-hit != 'true' }}
30- run : go mod download
31-
32- - name : Build
33- run : make bins
34-
35- - name : Test
36- run : make test
37-
38- integration-tests :
39- runs-on : ubuntu-latest
40- strategy :
41- matrix :
42- test-vector : [bitcoin-cln, bitcoin-lnd, liquid-cln, liquid-lnd, misc-integration, lwk-cln, lwk-lnd]
43- steps :
44- - name : Checkout code
45- uses : actions/checkout@v4
46- with :
47- fetch-depth : 0
48-
49- - uses : cachix/install-nix-action@v31
50- - uses : cachix/cachix-action@v16
51- with :
52- name : peerswap
53- authToken : ' ${{ secrets.CACHIX_AUTH_TOKEN }}'
54- useDaemon : true
55- # Switch to nix-shell for integration tests instead of nix develop.
56- # The 'nix develop' command can be unstable in some CI environments,
57- # causing issues like "clightning-1: Lost connection to the RPC socket."
58- # While the root cause is unclear, switching to nix-shell provides a more stable alternative for CI.
59- # For more context, see the issue in this failed job: https://github.com/ElementsProject/peerswap/actions/runs/16064376179/job/45336040866?pr=385
60- - name : Run integration tests
61- run : |
62- nix-shell --run "make test-${{matrix.test-vector}}"
1+ name : CI
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ pull_request :
8+ types : [opened, synchronize, reopened]
9+ workflow_dispatch :
10+
11+ env :
12+ SLOW_MACHINE : 1
13+
14+ jobs :
15+ unit-tests :
16+ runs-on : ubuntu-latest
17+
18+ steps :
19+ - name : Checkout code
20+ uses : actions/checkout@v3
21+
22+ - name : Set up Go
23+ uses : actions/setup-go@v4
24+ id : setup-go
25+ with :
26+ go-version-file : " go.mod"
27+
28+ - name : Download Go modules
29+ shell : bash
30+ if : ${{ steps.setup-go.outputs.cache-hit != 'true' }}
31+ run : go mod download
32+
33+ - name : Build
34+ run : make bins
35+
36+ - name : Test
37+ run : make test
38+
39+ integration-tests :
40+ runs-on : ubuntu-latest
41+ concurrency :
42+ group : integration-${{ github.ref }}-${{ matrix.vector }}
43+ cancel-in-progress : true
44+ needs : [build-test-bins]
45+ strategy :
46+ fail-fast : false
47+ matrix :
48+ vector :
49+ [
50+ bitcoin_clncln,
51+ bitcoin_mixed,
52+ bitcoin_lndlnd,
53+ liquid_clncln,
54+ liquid_mixed,
55+ liquid_lndlnd,
56+ misc_1,
57+ misc_2,
58+ misc_3,
59+ lnd,
60+ ]
61+ steps :
62+ - name : Checkout code
63+ uses : actions/checkout@v4
64+ with :
65+ fetch-depth : 1
66+
67+ - name : Set up Go
68+ uses : actions/setup-go@v4
69+ with :
70+ go-version-file : " go.mod"
71+
72+ - name : Cache Go modules
73+ id : go-cache
74+ uses : actions/cache@v3
75+ with :
76+ path : |
77+ ~/.cache/go-build
78+ ~/go/pkg/mod
79+ key : ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
80+ restore-keys : |
81+ ${{ runner.os }}-go-
82+
83+ - name : Download Go modules
84+ if : ${{ steps.go-cache.outputs.cache-hit != 'true' }}
85+ run : go mod download
86+
87+ # Test binaries are prebuilt and downloaded as artifact
88+ - name : Download test binaries
89+ uses : actions/download-artifact@v4
90+ with :
91+ name : test-bins
92+ path : out/test-builds
93+
94+ - uses : cachix/install-nix-action@v31
95+ - uses : cachix/cachix-action@v16
96+ with :
97+ name : peerswap
98+ authToken : " ${{ secrets.CACHIX_AUTH_TOKEN }}"
99+ useDaemon : true
100+ # Switch to nix-shell for integration tests instead of nix develop.
101+ # The 'nix develop' command can be unstable in some CI environments,
102+ # causing issues like "clightning-1: Lost connection to the RPC socket."
103+ # While the root cause is unclear, switching to nix-shell provides a more stable alternative for CI.
104+ # For more context, see the issue in this failed job: https://github.com/ElementsProject/peerswap/actions/runs/16064376179/job/45336040866?pr=385
105+ - name : Run integration tests
106+ env :
107+ INTEGRATION_TEST_PARALLEL : " 6"
108+ SKIP_BUILD_TEST_BINS : " 1"
109+ run : |
110+ nix-shell --run "RUN_INTEGRATION_TESTS=1 PAYMENT_RETRY_TIME=10 PEERSWAP_TEST_FILTER=$PEERSWAP_TEST_FILTER INTEGRATION_TEST_PARALLEL=$INTEGRATION_TEST_PARALLEL make test-matrix-${{ matrix.vector }}"
111+
112+ build-test-bins :
113+ runs-on : ubuntu-latest
114+ steps :
115+ - name : Checkout code
116+ uses : actions/checkout@v4
117+ with :
118+ fetch-depth : 1
119+
120+ - name : Set up Go
121+ uses : actions/setup-go@v4
122+ with :
123+ go-version-file : " go.mod"
124+
125+ - name : Cache Go modules
126+ id : go-cache
127+ uses : actions/cache@v3
128+ with :
129+ path : |
130+ ~/.cache/go-build
131+ ~/go/pkg/mod
132+ key : ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
133+ restore-keys : |
134+ ${{ runner.os }}-go-
135+
136+ - name : Download Go modules
137+ if : ${{ steps.go-cache.outputs.cache-hit != 'true' }}
138+ run : go mod download
139+
140+ - name : Build test binaries
141+ run : make test-bins
142+
143+ - name : Upload test binaries
144+ uses : actions/upload-artifact@v4
145+ with :
146+ name : test-bins
147+ path : out/test-builds
0 commit comments