-
Notifications
You must be signed in to change notification settings - Fork 1
97 lines (79 loc) · 2.22 KB
/
ci-dev-ops.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
93
94
95
96
97
name: ci-dev-ops
defaults:
run:
working-directory: .
on:
workflow_dispatch:
push:
branches:
- "main*"
- "development*"
- "ops*"
paths:
- "packages/ops/**"
- "packages/contracts/**"
- "packages/api/**"
- ".github/workflows/ci-dev-ops.yml"
jobs:
deploy:
runs-on: ubuntu-latest
environment: testnet
steps:
- name: Checkout
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:
version: nightly
- name: Install Project Dependencies
run: yarn install
- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Setup Local Environment
run: find . -type f -name ".env*.sample" -exec sh -c 'F={}; cp -nv $F $(dirname $F)/$(basename $F .sample)' \;
working-directory: .
# Docker compose detached (-d) so other jobs can continue
# Env variables are sourced and then exported (set -a)
- name: Run Docker compose detached
run: |
set -a
source packages/api/.env
set +a
docker-compose up -d --build
- name: Setup Supabase CLI
uses: supabase/[email protected]
with:
version: latest
- name: Start Supabase
run: supabase start
working-directory: packages/api
- name: Deploy Credbull Contracts
run: yarn deploy
working-directory: packages/contracts
- name: Logs
run: docker logs api --tail all
- name: Run Ops tests
run: |
set -a
source ../api/.env
source .env
set +a
yarn int-test
working-directory: packages/ops
- name: Clean vault data
run: yarn op --clean-vault-table
working-directory: packages/ops
- name: Cleanup Yarn Cache
if: always()
run: yarn cache clean