-
Notifications
You must be signed in to change notification settings - Fork 3
77 lines (67 loc) · 2.02 KB
/
backend-test.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
name: Backend Test
on:
pull_request:
paths:
- backend/**
push:
branches: [main, develop]
paths:
- backend/**
jobs:
build:
runs-on: ubuntu-latest
services:
redis-cache:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
redis-queue:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6380:6379
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install PNPM
uses: pnpm/action-setup@v3
with:
version: 8
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '21'
cache: 'pnpm'
- uses: pnpm/action-setup@v4
- name: Install dependency
run: pnpm install
- name: Run Build
run: pnpm run build
working-directory: backend
- name: Run Test
run: |
touch .env
echo BITCOIN_PRIMARY_DATA_PROVIDER="${{ secrets.BITCOIN_PRIMARY_DATA_PROVIDER }}" >> .env
echo BITCOIN_MEMPOOL_SPACE_API_URL="${{ secrets.BITCOIN_MEMPOOL_SPACE_API_URL }}" >> .env
echo BITCOIN_ELECTRS_API_URL="{{ secrets.BITCOIN_ELECTRS_API_URL }}" >> .env
echo CKB_EXPLORER_API_URL="${{ secrets.CKB_EXPLORER_API_URL }}" >> .env
echo CKB_RPC_WEBSOCKET_URL="${{ secrets.CKB_RPC_WEBSOCKET_URL }}" >> .env
echo REDIS_CACHE_URL="redis://localhost:6379" >> .env
echo REDIS_QUEUE_URL="redis://localhost:6380" >> .env
echo DATABASE_URL="postgres://postgres:postgres@postgres:5432/explorer?sslmode=disable" >> .env
cat .env
pnpm run test
working-directory: backend
- name: Docker Build Test
run: docker compose build