@@ -15,67 +15,68 @@ jobs:
1515 node-version : [18.x, 20.x]
1616
1717 steps :
18- - name : Checkout code
19- uses : actions/checkout@v4
18+ - name : Checkout code
19+ uses : actions/checkout@v4
2020
21- - name : Setup Node.js ${{ matrix.node-version }}
22- uses : actions/setup-node@v4
23- with :
24- node-version : ${{ matrix.node-version }}
25- cache : ' npm'
21+ - name : Setup Node.js ${{ matrix.node-version }}
22+ uses : actions/setup-node@v4
23+ with :
24+ node-version : ${{ matrix.node-version }}
25+ cache : ' npm'
2626
27- - name : Install dependencies
28- run : npm ci
27+ - name : Install dependencies
28+ run : npm ci
2929
30- - name : Run type checking
31- run : npm run type-check
30+ - name : Run type checking
31+ run : npm run type-check
3232
33- - name : Run linting
34- run : npm run lint
33+ - name : Run linting
34+ run : npm run lint
3535
36- - name : Check code formatting
37- run : npm run format:check
36+ - name : Check code formatting
37+ run : npm run format:check
3838
39- - name : Run tests
40- run : npm run test:coverage
39+ - name : Run tests
40+ run : npm run test:coverage
4141
42- - name : Upload coverage to Codecov
43- uses : codecov/codecov-action@v3
44- with :
45- token : ${{ secrets.CODECOV_TOKEN }}
46- file : ./coverage/lcov.info
47- flags : unittests
48- name : codecov-umbrella
42+ - name : Upload coverage to Codecov
43+ uses : codecov/codecov-action@v5
44+ with :
45+ token : ${{ secrets.CODECOV_TOKEN }} # or set `use_oidc: true` + permissions
46+ files : ./coverage/lcov.info
47+ flags : unittests
48+ name : codecov-umbrella
49+ fail_ci_if_error : true
4950
5051 build :
5152 name : Build
5253 runs-on : ubuntu-latest
5354 needs : test
5455
5556 steps :
56- - name : Checkout code
57- uses : actions/checkout@v4
57+ - name : Checkout code
58+ uses : actions/checkout@v4
5859
59- - name : Setup Node.js
60- uses : actions/setup-node@v4
61- with :
62- node-version : ' 18.x'
63- cache : ' npm'
60+ - name : Setup Node.js
61+ uses : actions/setup-node@v4
62+ with :
63+ node-version : ' 18.x'
64+ cache : ' npm'
6465
65- - name : Install dependencies
66- run : npm ci
66+ - name : Install dependencies
67+ run : npm ci
6768
68- - name : Build application
69- run : npm run build
69+ - name : Build application
70+ run : npm run build
7071
71- - name : Validate configuration
72- run : npm run validate-config
72+ - name : Validate configuration
73+ run : npm run validate-config
7374
74- - name : Upload build artifacts
75- uses : actions/upload-artifact@v3
76- with :
77- name : build-artifacts
78- path : dist/
75+ - name : Upload build artifacts
76+ uses : actions/upload-artifact@v4
77+ with :
78+ name : build-artifacts
79+ path : dist/
7980
8081 docker :
8182 name : Docker Build
@@ -84,60 +85,61 @@ jobs:
8485 if : github.event_name == 'push'
8586
8687 steps :
87- - name : Checkout code
88- uses : actions/checkout@v4
89-
90- - name : Set up Docker Buildx
91- uses : docker/setup-buildx-action@v3
92-
93- - name : Login to Docker Hub
94- uses : docker/login-action@v3
95- with :
96- username : ${{ secrets.DOCKER_USERNAME }}
97- password : ${{ secrets.DOCKER_PASSWORD }}
98-
99- - name : Extract metadata
100- id : meta
101- uses : docker/metadata-action@v5
102- with :
103- images : onamfc/mcp-starter-template
104- tags : |
105- type=ref,event=branch
106- type=ref,event=pr
107- type=sha
108-
109- - name : Build and push Docker image
110- uses : docker/build-push-action@v5
111- with :
112- context : .
113- platforms : linux/amd64,linux/arm64
114- push : true
115- tags : ${{ steps.meta.outputs.tags }}
116- labels : ${{ steps.meta.outputs.labels }}
117- cache-from : type=gha
118- cache-to : type=gha,mode=max
88+ - name : Checkout code
89+ uses : actions/checkout@v4
90+
91+ - name : Set up Docker Buildx
92+ uses : docker/setup-buildx-action@v3
93+
94+ - name : Login to Docker Hub
95+ uses : docker/login-action@v3
96+ with :
97+ username : ${{ secrets.DOCKER_USERNAME }}
98+ password : ${{ secrets.DOCKER_PASSWORD }}
99+
100+ - name : Extract metadata
101+ id : meta
102+ uses : docker/metadata-action@v5
103+ with :
104+ images : onamfc/mcp-starter-template
105+ tags : |
106+ type=ref,event=branch
107+ type=ref,event=pr
108+ type=sha
109+
110+ - name : Build and push Docker image
111+ uses : docker/build-push-action@v5
112+ with :
113+ context : .
114+ platforms : linux/amd64,linux/arm64
115+ push : true
116+ tags : ${{ steps.meta.outputs.tags }}
117+ labels : ${{ steps.meta.outputs.labels }}
118+ cache-from : type=gha
119+ cache-to : type=gha,mode=max
119120
120121 security :
121122 name : Security Scan
122123 runs-on : ubuntu-latest
123124 needs : test
124125
125126 steps :
126- - name : Checkout code
127- uses : actions/checkout@v4
127+ - name : Checkout code
128+ uses : actions/checkout@v4
128129
129- - name : Setup Node.js
130- uses : actions/setup-node@v4
131- with :
132- node-version : ' 18.x'
133- cache : ' npm'
130+ - name : Setup Node.js
131+ uses : actions/setup-node@v4
132+ with :
133+ node-version : ' 18.x'
134+ cache : ' npm'
134135
135- - name : Install dependencies
136- run : npm ci
136+ - name : Install dependencies
137+ run : npm ci
137138
138- - name : Run security audit
139- run : npm audit --audit-level=moderate
139+ - name : Run security audit
140+ run : npm audit --audit-level=moderate
141+
142+ - name : Run dependency check
143+ if : github.event_name == 'pull_request'
144+ uses : actions/dependency-review-action@v4
140145
141- - name : Run dependency check
142- uses : actions/dependency-review-action@v3
143- if : github.event_name == 'pull_request'
0 commit comments