-
Notifications
You must be signed in to change notification settings - Fork 2
152 lines (150 loc) · 4.75 KB
/
Copy pathci.yml
File metadata and controls
152 lines (150 loc) · 4.75 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: CI
on:
pull_request:
branches: [develop]
push:
branches: [develop]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Frontend App Tests (Node 22 + pnpm)
- name: Setup Node.js 22 for frontend
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Enable pnpm for frontend
run: corepack enable && corepack prepare pnpm@latest --activate
- name: Cache pnpm dependencies
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('app/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install frontend dependencies
run: |
cd app
pnpm install --frozen-lockfile
env:
MM_GHT: ${{ secrets.MM_GHT }}
# - name: App Coverage Test
# run: |
# cd app
# pnpm run test:unit -- --coverage
# env:
# CI: true
# - name: Upload Test Coverage
# uses: actions/upload-artifact@v4
# with:
# name: app-coverage-report
# path: app/coverage
# Restful Service Tests (Node 17.9.1 + npm)
- name: Setup Node.js 17.9.1 for restful service
uses: actions/setup-node@v4
with:
node-version: '17.9.1'
- name: Cache npm dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key:
${{ runner.os }}-node-${{
hashFiles('resfulservice/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install restful service dependencies
run: |
cd resfulservice
npm install
- name: Run restful service tests
run: |
cd resfulservice
npm run test
env:
CI: true
- run: npm install
# - run: npm run test
BuildFrontend:
needs: [test]
uses: Duke-MatSci/materialsmine/.github/workflows/builder.yml@develop
with:
myid: app
context: ./app
dockerfile: Dockerfile.stage
tags: dukematsci/dev-app:latest
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
MM_GHT: ${{ secrets.MM_GHT }}
FE_PORT: ${{ secrets.FE_PORT }}
BuildProxy:
needs: [test]
uses: Duke-MatSci/materialsmine/.github/workflows/builder.yml@develop
with:
myid: proxy
context: ./nginx
tags: dukematsci/dev-proxy:latest
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
BuildRESTFUL:
needs: [test]
uses: Duke-MatSci/materialsmine/.github/workflows/builder.yml@develop
with:
myid: restful
context: ./resfulservice
dockerfile: Dockerfile
tags: dukematsci/dev-restful:latest
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
BuildManagedServices:
needs: [test]
uses: Duke-MatSci/materialsmine/.github/workflows/builder.yml@develop
with:
myid: managedservices
context: ./services
tags: dukematsci/dev-managedservices:latest
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
BuildWhyis:
if: github.event_name == 'push'
uses: Duke-MatSci/materialsmine/.github/workflows/builder.yml@develop
with:
myid: kgapp
context: ./whyis
tags: dukematsci/dev-kgapp:latest
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
TestBuild:
if: github.event_name != 'push'
runs-on: ubuntu-latest
needs: [BuildFrontend, BuildRESTFUL, BuildProxy, BuildWhyis]
env:
MM_MONGO_USER: ${{secrets.MM_MONGO_USER}}
MM_MONGO_PWD: ${{secrets.MM_MONGO_PWD}}
MONGO_TEST: ${{secrets.MONGO_TEST}}
MONGO_TEST_PWD: ${{secrets.MONGO_TEST_PWD}}
MM_DB: ${{secrets.MM_DB}}
MONGO_ADDRESS: ${{secrets.MONGO_ADDRESS}}
MONGO_PORT: ${{secrets.MONGO_PORT}}
NM_MONGO_DUMP: ${{secrets.NM_MONGO_DUMP}}
TKNS: ${{secrets.TKNS}}
MINIO_ROOT_USER: ${{secrets.MINIO_ROOT_USER}}
MINIO_ROOT_PASSWORD: ${{secrets.MINIO_ROOT_PASSWORD}}
PROXY_PORT: ${{secrets.PROXY_PORT}}
MINIO_PORT: ${{secrets.MINIO}}
ES_PORT: ${{secrets.ES_PORT}}
PORT: ${{secrets.PORT}}
CLIENT_PORT: ${{secrets.CLIENT_PORT}}
KG_PORT: ${{secrets.KG_PORT}}
steps:
- uses: actions/checkout@v4
- name: Download and run images
run: docker-compose -f docker-compose.git.yml up -d
- name: Kill containers
run: docker-compose down -v