-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (72 loc) · 2.49 KB
/
ci-dev-sdk.yml
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
name: ci-dev-sdk
defaults:
run:
working-directory: .
on:
workflow_dispatch:
push:
branches:
- "main*"
- "dev/**"
paths:
- "packages/sdk/**"
- "packages/contracts/**"
- "packages/api/**"
- ".github/workflows/ci-dev-sdk.yml"
jobs:
sdk-int-test:
runs-on: ubuntu-latest
environment: local
steps:
- name: Checkout credbull-defi
uses: actions/checkout@v4
- name: Install yarn
run: |
corepack prepare yarn@stable --activate
npm install -g yarn
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
- name: Install foundry-toolchain
uses: foundry-rs/[email protected]
with:
# using 2024-10-19 Nightly https://github.com/foundry-rs/foundry/tree/nightly-a8c3e9c1376122e7030dbe5c695b2f1f2a6f389b
# latest gives "deserialization error: duplicate field `status` at line 1 column 1085"
# see failure: https://github.com/credbull/credbull-defi/actions/runs/11576938626/job/32227114227
version: nightly-a8c3e9c1376122e7030dbe5c695b2f1f2a6f389b
- name: Install Project Dependencies
run: yarn install
- name: Setup Local Environment
run: find . -type f -name ".env*.sample" -exec sh -c 'F={}; cp -nv $F $(dirname $F)/$(basename $F .sample)' \;
- name: Build Project
run: yarn build
- name: Setup Supabase CLI
uses: supabase/[email protected]
with:
version: latest
- name: Start Supabase
run: supabase start
working-directory: packages/api
- name: Run Docker Compose with Background Services
run: docker compose --env-file packages/api/.env up --detach --build --wait
- name: Deploy Credbull Contracts
run: yarn deploy
working-directory: packages/contracts
- name: Create Default Users
run: yarn op --create-default-users
working-directory: packages/ops
- name: Run SDK Integration Tests
run: yarn int-test
working-directory: packages/sdk
- name: See API Logs, If Tests Failed
run: docker logs api
if: ${{ failure() }}
- name: Shutdown Docker Compose detached
run: docker compose --env-file packages/api/.env down
if: ${{ always() }}
- name: Stop Supabase
run: supabase stop --no-backup
working-directory: packages/api
if: ${{ always() }}