-
Notifications
You must be signed in to change notification settings - Fork 34
89 lines (72 loc) · 2.4 KB
/
Copy pathci.yml
File metadata and controls
89 lines (72 loc) · 2.4 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
name: TrustLend CI/CD
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
permissions:
contents: read
jobs:
test-smart-contracts:
name: Test Soroban Contracts
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: contracts
- name: Run Tests
working-directory: ./contracts
run: cargo test
- name: Compile Contracts (Dry Run)
working-directory: ./contracts
run: cargo build --target wasm32-unknown-unknown --release
build-frontend:
name: Build Next.js Application
runs-on: ubuntu-latest
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Typecheck
run: npx tsc --noEmit
- name: Lint
run: npm run lint
- name: Unit tests
run: npm test
- name: Build Next.js
# Placeholder env so the build never needs real secrets.
env:
NEXT_PUBLIC_STELLAR_NETWORK: "testnet"
NEXT_PUBLIC_STELLAR_HORIZON_URL: "https://horizon-testnet.stellar.org"
NEXT_PUBLIC_ADMIN_ADDRESS: "GAJRNUO6HSMQG4FNHNWQVRXJZJZ7QRA7HXPYYB6H5PTA3EAAJXJNZD7U"
run: npm run build
# Apply pending Drizzle migrations to the production database before the
# deploy goes live. No-op until the DATABASE_URL secret exists.
- name: Migrate database
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && env.DATABASE_URL != '' }}
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: npm run db:migrate
- name: Deploy to Vercel
if: ${{ env.VERCEL_TOKEN != '' }}
run: npx vercel --prod --yes --token=${{ env.VERCEL_TOKEN }}
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}