3333 working-directory : contracts
3434 run : make build
3535
36- - name : Run contract tests
36+ - name : Run contract tests with coverage
3737 working-directory : contracts
38- run : make test
38+ run : |
39+ cargo install cargo-tarpaulin
40+ make test-coverage
41+
42+ - name : Upload Contract Coverage to Codecov
43+ uses : codecov/codecov-action@v4
44+ with :
45+ files : contracts/tarpaulin-report.xml
46+ flags : contracts
47+ token : ${{ secrets.CODECOV_TOKEN }}
48+
49+ - name : Install cargo-audit
50+ run : cargo install cargo-audit
51+
52+ - name : Dependency audit
53+ working-directory : contracts
54+ run : cargo audit | tee audit-report.txt
55+
56+ - name : Upload audit report
57+ if : always()
58+ uses : actions/upload-artifact@v4
59+ with :
60+ name : contract-audit-report
61+ path : contracts/audit-report.txt
3962
4063 backend :
4164 name : Node.js backend
5477 working-directory : backend
5578 run : npm ci
5679
57- - name : Run tests
80+ - name : Run tests with coverage
81+ working-directory : backend
82+ run : npm run test:coverage
83+
84+ - name : Upload Backend Coverage to Codecov
85+ uses : codecov/codecov-action@v4
86+ with :
87+ files : backend/coverage/lcov.info
88+ flags : backend
89+ token : ${{ secrets.CODECOV_TOKEN }}
90+
91+ frontend :
92+ name : Node.js frontend
93+ runs-on : ubuntu-latest
94+ steps :
95+ - uses : actions/checkout@v4
96+
97+ - name : Setup Node.js
98+ uses : actions/setup-node@v4
99+ with :
100+ node-version : 18
101+ cache : npm
102+ cache-dependency-path : frontend/package-lock.json
103+
104+ - name : Install dependencies
105+ working-directory : frontend
106+ run : npm install --legacy-peer-deps
107+
108+ - name : Run tests with coverage
109+ working-directory : frontend
110+ run : npm run test:coverage
111+
112+ - name : Upload Frontend Coverage to Codecov
113+ uses : codecov/codecov-action@v4
114+ with :
115+ files : frontend/coverage/lcov.info
116+ flags : frontend
117+ token : ${{ secrets.CODECOV_TOKEN }}
118+
119+ - name : Dependency audit
58120 working-directory : backend
59- run : npm test
121+ run : npm audit --audit-level=high | tee audit-report.txt
122+
123+ - name : Upload audit report
124+ if : always()
125+ uses : actions/upload-artifact@v4
126+ with :
127+ name : backend-audit-report
128+ path : backend/audit-report.txt
129+
130+ frontend :
131+ name : Node.js frontend
132+ runs-on : ubuntu-latest
133+ steps :
134+ - uses : actions/checkout@v4
135+
136+ - name : Setup Node.js
137+ uses : actions/setup-node@v4
138+ with :
139+ node-version : 18
140+ cache : npm
141+ cache-dependency-path : frontend/package-lock.json
142+
143+ - name : Install dependencies
144+ working-directory : frontend
145+ run : npm ci
146+
147+ - name : Dependency audit
148+ working-directory : frontend
149+ run : npm audit --audit-level=high | tee audit-report.txt
150+
151+ - name : Upload audit report
152+ if : always()
153+ uses : actions/upload-artifact@v4
154+ with :
155+ name : frontend-audit-report
156+ path : frontend/audit-report.txt
60157
61158 python :
62159 name : Python analytics service
@@ -75,10 +172,30 @@ jobs:
75172 working-directory : python-service
76173 run : pip install -r requirements.txt
77174
78- - name : Run tests
175+ - name : Run tests with coverage
79176 working-directory : python-service
80177 run : pytest
81178
179+ - name : Upload Python Coverage to Codecov
180+ uses : codecov/codecov-action@v4
181+ with :
182+ files : python-service/coverage.xml
183+ flags : python
184+ token : ${{ secrets.CODECOV_TOKEN }}
185+ - name : Install pip-audit
186+ run : pip install pip-audit
187+
188+ - name : Dependency audit
189+ working-directory : python-service
190+ run : pip-audit -r requirements.txt | tee audit-report.txt
191+
192+ - name : Upload audit report
193+ if : always()
194+ uses : actions/upload-artifact@v4
195+ with :
196+ name : python-audit-report
197+ path : python-service/audit-report.txt
198+
82199 docker :
83200 name : Docker build validation
84201 runs-on : ubuntu-latest
0 commit comments