Skip to content

Commit 3ac4998

Browse files
authored
Merge branch 'main' into feat/issue-152-matching-engine
2 parents b93814a + 872f719 commit 3ac4998

368 files changed

Lines changed: 49023 additions & 12036 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/a11y-nightly.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Nightly Accessibility Scan
2+
3+
# Runs every day at 06:00 UTC (≈1:00 AM EST). Also runs on manual trigger.
4+
on:
5+
schedule:
6+
- cron: "0 6 * * *"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
a11y-scan:
14+
name: Axe DevTools AA scan (live pages)
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 25
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: "20"
25+
cache: npm
26+
cache-dependency-path: frontend/package-lock.json
27+
28+
- name: Install frontend dependencies
29+
working-directory: frontend
30+
run: npm ci
31+
32+
- name: Install Playwright Chromium
33+
working-directory: frontend
34+
run: npx playwright install --with-deps chromium
35+
36+
- name: Build Next.js production bundle
37+
working-directory: frontend
38+
run: npm run build
39+
env:
40+
NEXT_PUBLIC_STELLAR_NETWORK: testnet
41+
NEXT_PUBLIC_HORIZON_URL: https://horizon-testnet.stellar.org
42+
NEXT_PUBLIC_API_URL: http://localhost:4000
43+
44+
- name: Start Next.js server in background
45+
working-directory: frontend
46+
run: |
47+
nohup npm run start > next-start.log 2>&1 &
48+
# Wait up to 60s for the server to respond.
49+
timeout 60 bash -c 'until curl -fs http://localhost:3000 > /dev/null; do sleep 2; done'
50+
echo "Next.js server is up."
51+
52+
- name: Run axe-core scan
53+
working-directory: frontend
54+
run: npm run a11y:scan
55+
56+
- name: Upload a11y report
57+
if: always()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: a11y-report
61+
path: frontend/a11y-report.json
62+
if-no-files-found: warn
63+
64+
- name: Upload server log
65+
if: failure()
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: next-start.log
69+
path: frontend/next-start.log
70+
if-no-files-found: ignore

.github/workflows/backend.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,6 @@ on:
66
pull_request:
77

88
jobs:
9-
frontend:
10-
name: Frontend (Next.js)
11-
runs-on: ubuntu-latest
12-
defaults:
13-
run:
14-
working-directory: frontend
15-
steps:
16-
- uses: actions/checkout@v4
17-
- uses: actions/setup-node@v4
18-
with:
19-
node-version: "20"
20-
cache: "npm"
21-
cache-dependency-path: frontend/package-lock.json
22-
- run: npm ci
23-
- run: npm run type-check
24-
- run: npm run lint
25-
- run: npm run build
26-
env:
27-
NEXT_PUBLIC_STELLAR_NETWORK: testnet
28-
NEXT_PUBLIC_HORIZON_URL: https://horizon-testnet.stellar.org
29-
NEXT_PUBLIC_API_URL: http://localhost:4000
30-
319
backend:
3210
name: Backend (Node.js)
3311
runs-on: ubuntu-latest
@@ -43,26 +21,18 @@ jobs:
4321
cache-dependency-path: backend/package-lock.json
4422
- run: npm ci
4523
- run: npm run lint
46-
- run: docker compose -f docker-compose.test.yml up --abort-on-container-exit --exit-code-from backend --build
47-
working-directory: .
48-
49-
contracts:
50-
name: Soroban Contracts (Rust)
51-
runs-on: ubuntu-latest
52-
defaults:
53-
run:
54-
working-directory: contracts
55-
steps:
56-
- uses: actions/checkout@v4
57-
- uses: dtolnay/rust-toolchain@stable
24+
- uses: docker/setup-buildx-action@v3
25+
- uses: docker/build-push-action@v7
5826
with:
59-
targets: wasm32v1-none
60-
- uses: Swatinem/rust-cache@v2
61-
with:
62-
workspaces: contracts
63-
- run: cargo check --workspace
64-
- run: cargo test --workspace
65-
- run: cargo build --workspace --target wasm32v1-none --release
27+
context: ./backend
28+
file: ./backend/Dockerfile
29+
target: test
30+
load: true
31+
tags: indigopay-backend-test:ci
32+
cache-from: type=gha
33+
cache-to: type=gha,mode=max
34+
- run: docker compose -f docker-compose.test.yml up --abort-on-container-exit --exit-code-from backend
35+
working-directory: .
6636

6737
helm:
6838
name: Helm Chart Validation

.github/workflows/contracts.yml

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ on:
77
pull_request:
88
paths: [contracts/**]
99
workflow_dispatch:
10-
schedule:
11-
# Nightly deep fuzz run -- 1 000 000 iterations every day at 03:00 UTC
12-
- cron: "0 3 * * *"
1310

1411
jobs:
1512
test:
@@ -46,7 +43,7 @@ jobs:
4643
run: cargo build --workspace --target wasm32v1-none --release
4744

4845
fuzz:
49-
name: Fuzz Tests (10k iterations)
46+
name: Fuzz Tests (256 cases each)
5047
runs-on: ubuntu-latest
5148
timeout-minutes: 20
5249
defaults:
@@ -67,13 +64,13 @@ jobs:
6764
with:
6865
workspaces: contracts
6966

70-
- name: Run fuzz tests (10k iterations)
67+
- name: Run fuzz tests
7168
run: cargo test --features testutils -- fuzz
7269
env:
73-
FUZZ_ITERATIONS: 10000
70+
FUZZ_ITERATIONS: 256
7471

7572
deep-fuzz:
76-
name: Deep Fuzz (1M iterations -- nightly)
73+
name: Deep Fuzz (2k cases each -- nightly)
7774
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
7875
runs-on: ubuntu-latest
7976
timeout-minutes: 120
@@ -95,10 +92,61 @@ jobs:
9592
with:
9693
workspaces: contracts
9794

98-
- name: Run deep fuzz tests (1M iterations)
95+
deep-fuzz:
96+
name: Deep Fuzz (2k cases each -- nightly)
97+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
98+
runs-on: ubuntu-latest
99+
timeout-minutes: 120
100+
defaults:
101+
run:
102+
working-directory: contracts
103+
steps:
104+
- uses: actions/checkout@v4
105+
106+
- name: Install Rust toolchain
107+
uses: dtolnay/rust-toolchain@stable
108+
with:
109+
toolchain: 1.91.0
110+
targets: wasm32v1-none
111+
components: rustfmt, clippy
112+
113+
- name: Cache Rust dependencies
114+
uses: Swatinem/rust-cache@v2
115+
with:
116+
workspaces: contracts
117+
118+
- name: Run deep fuzz tests
119+
run: cargo test --features testutils -- fuzz
120+
env:
121+
FUZZ_ITERATIONS: 2000
122+
123+
deep-fuzz-pr:
124+
name: Deep Fuzz (500 cases each -- PR)
125+
if: github.event_name == 'pull_request'
126+
runs-on: ubuntu-latest
127+
timeout-minutes: 30
128+
defaults:
129+
run:
130+
working-directory: contracts
131+
steps:
132+
- uses: actions/checkout@v4
133+
134+
- name: Install Rust toolchain
135+
uses: dtolnay/rust-toolchain@stable
136+
with:
137+
toolchain: 1.91.0
138+
targets: wasm32v1-none
139+
components: rustfmt, clippy
140+
141+
- name: Cache Rust dependencies
142+
uses: Swatinem/rust-cache@v2
143+
with:
144+
workspaces: contracts
145+
146+
- name: Run deep fuzz tests
99147
run: cargo test --features testutils -- fuzz
100148
env:
101-
FUZZ_ITERATIONS: 1000000
149+
FUZZ_ITERATIONS: 500
102150

103151
coverage:
104152
name: Coverage (tarpaulin)
@@ -125,7 +173,7 @@ jobs:
125173
workspaces: contracts
126174

127175
- name: Run coverage
128-
run: cargo tarpaulin --config indigopay-contract/.tarpaulin.toml --out Html --out Lcov
176+
run: cargo tarpaulin --config indigopay-contract/.tarpaulin.toml --features testutils --out Html --out Lcov -- --skip fuzz
129177

130178
- name: Upload coverage report
131179
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)