forked from Transia-RnD/XrplCSharp
-
Notifications
You must be signed in to change notification settings - Fork 1
118 lines (104 loc) · 4.66 KB
/
Copy pathdotnet.test.yml
File metadata and controls
118 lines (104 loc) · 4.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: .NET CI
env:
DOTNET_VERSION: '10.0.x'
on:
push:
branches: [ dev, release ]
pull_request:
branches: [ dev, release ]
merge_group:
workflow_dispatch:
# New pushes to a PR cancel its in-flight run; push/merge-queue runs are never cancelled
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build-and-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use .NET ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build
run: dotnet build
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use .NET ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build
run: dotnet build
- name: Test Unit
run: dotnet test --verbosity normal --settings test.runsettings --filter "TestU"
integration:
# PRs into dev skip integration — it runs for real in the merge queue
# (merge_group) before the merge lands, and on promotion PRs into release.
# A skipped required check counts as satisfied, but the dev merge queue
# re-runs it on the merge result, so the gate holds.
if: github.event_name != 'pull_request' || github.base_ref == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start rippled + ledger-acceptor
run: docker compose -f .ci-config/docker-compose.ci.yml up -d
- name: Wait for rippled to be ready
run: |
# AMM amendment id (sha512half of the name) — sentinel for genesis
# amendment activation from the [amendments] section in rippled.cfg.
# Without this check tests start against a node where amendment-gated
# transactors return temDISABLED and the affected tests silently skip.
SENTINEL="8CC0774A3BF66D1D22E76BBDA8E8A232E6B6313834301B3B23E8601196AE6455"
for i in $(seq 1 30); do
if curl -sf --max-time 5 http://localhost:5005/ -d '{"method":"server_info"}' > /dev/null 2>&1; then
# `|| true`: this step runs under bash -e; a jq parse failure on a
# partial/garbage response would otherwise abort the whole step
# instead of letting the loop retry.
enabled=$(curl -sf --max-time 5 http://localhost:5005/ \
-d "{\"method\":\"feature\",\"params\":[{\"feature\":\"$SENTINEL\"}]}" \
| jq -r ".result.\"$SENTINEL\".enabled" 2>/dev/null || true)
if [ "$enabled" = "true" ]; then
echo "rippled is ready, sentinel amendment (AMM) is enabled"
exit 0
fi
echo "rippled is up but sentinel amendment not enabled yet... ($i/30)"
else
echo "Waiting for rippled... ($i/30)"
fi
sleep 2
done
echo "::error::rippled did not become ready (or amendments inactive) after 30 attempts — dumping diagnostics"
docker compose -f .ci-config/docker-compose.ci.yml ps
docker compose -f .ci-config/docker-compose.ci.yml logs --no-color xrpld
exit 1
- name: Use .NET ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build
# The standalone profile is the default (XRPL_TEST_NODE unset -> ws://localhost:6006);
# a stand on other ports or a public network is selected with XRPL_TEST_NODE_URL /
# XRPL_TEST_NODE, see Tests/Xrpl.Tests/Integration/README.md and devnet-coverage.yml.
- name: Test Integration
run: dotnet test Tests/Xrpl.Tests/Xrpl.Tests.csproj --verbosity normal --settings test.runsettings --filter "TestI"
# x402 integration tests: hermetic E2E against the standalone rippled above.
# The live t54 interop tests (TestCategory=Live) are excluded — they are the only tests
# in the suite that reach outside, needing the public XRPL testnet faucet and the hosted
# t54 facilitator, so leaving them in made a green build depend on two third-party
# services. Run them deliberately:
# dotnet test Tests/Xrpl.X402.Tests/Xrpl.X402.Tests.csproj --filter "TestCategory=Live"
- name: Test Integration (Xrpl.X402)
run: dotnet test Tests/Xrpl.X402.Tests/Xrpl.X402.Tests.csproj --verbosity normal --settings test.runsettings --filter "TestI&TestCategory!=Live"
env:
HOST: localhost
PORT: 6006
- name: Stop docker containers
if: always()
run: docker compose -f .ci-config/docker-compose.ci.yml down