Skip to content

Commit 423a20b

Browse files
chore(ci): add caching to test-md
This dramatically improves the build and test time. Achieved by: - manually building the required binaries with caching - `run-md-test.sh` from binaries (no delete pre-run) Note that the caching doesn't support multiple repo's, so the settlement-engine build is split into a separate job.
1 parent 876466e commit 423a20b

File tree

1 file changed

+57
-5
lines changed

1 file changed

+57
-5
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,69 @@ jobs:
130130
- name: Test --features strict
131131
run: timeout 15m cargo test -p interledger-btp --features strict
132132

133+
134+
settlement-engines:
135+
# This job builds the ethereum-settlement-engine required by `test-md`.
136+
# A separate job to enable dependency caching.
137+
runs-on: ubuntu-latest
138+
139+
steps:
140+
- name: Checkout sources
141+
uses: actions/checkout@v2
142+
with:
143+
repository: interledger-rs/settlement-engines
144+
ref: master
145+
146+
- name: Install rust toolchain
147+
uses: hecrj/setup-rust-action@v1.3.4
148+
with:
149+
rust-version: stable
150+
151+
- name: Cache
152+
uses: Swatinem/rust-cache@v1
153+
154+
- name: Build
155+
run: cargo build --bin ilp-settlement-ethereum
156+
157+
- name: Upload settlement-engine artifact
158+
uses: actions/upload-artifact@v2
159+
with:
160+
name: settlement-engine
161+
path: target/debug/ilp-settlement-ethereum
162+
133163
test-md:
164+
env:
165+
RUST_LOG: "interledger=trace"
166+
RUST_BACKTRACE: "full"
167+
168+
needs: settlement-engines
169+
134170
runs-on: ubuntu-latest
171+
135172
steps:
136173
- name: Checkout sources
137174
uses: actions/checkout@v2
138175

139-
- name: Install node
140-
uses: actions/setup-node@v2
176+
- name: Install rust toolchain
177+
uses: hecrj/setup-rust-action@v1.3.4
141178
with:
142-
node-version: 'v12.18.4'
179+
rust-version: stable
180+
181+
- name: Cache
182+
uses: Swatinem/rust-cache@v1
183+
184+
- name: Build binaries
185+
run: |
186+
mkdir -p ~/.interledger/bin
187+
cargo build --bin ilp-node --bin ilp-cli
188+
mv target/debug/ilp-node ~/.interledger/bin
189+
mv target/debug/ilp-cli ~/.interledger/bin
190+
191+
- name: Download settlement engine artifact
192+
uses: actions/download-artifact@v2
193+
with:
194+
name: settlement-engine
195+
path: ~/.interledger/bin
143196

144197
- name: Install dependencies
145198
run: |
@@ -150,8 +203,7 @@ jobs:
150203
npm install -g ganache-cli ilp-settlement-xrp conventional-changelog-cli
151204
152205
- name: Test
153-
run: |
154-
scripts/run-md-test.sh '^.*$' 1
206+
run: scripts/run-md-test.sh '^.*$' 2
155207

156208
- name: 'Store artifacts'
157209
if: ${{ failure() }}

0 commit comments

Comments
 (0)