How to run angular CICD on gitlab-runner of wsl?

前提文件

.gitlab-ci.yml, .dockerignore, ci-funcs.sh, Dockerfile, karma.conf.js, nginx.conf, nginx-custom.conf, sonar-project.properties

1.test.ts

const context = require.context('./app/pages', true, /\.spec\.ts$/);

2.sonar-project.properties

sonar.sources=src/app/xxx

sonar.javascript.lcov.reportPaths=coverage/lcov.info

3.karma.conf.js

coverageIstanbulReporter: {

dir: require('path').join(__dirname, './coverage'),

reports: ['html', 'lcovonly', 'text-summary'],

fixWebpackSourcePaths: true

},

4.angular.json

"test": {

...,

"codeCoverage": true

},

5.config.toml

\[runners\]

name = "webapp-angular runner on wsl"

url = "https://gitlab.xxx.com/"

token = "..."

executor = "docker"

runners.custom_build_dir

runners.cache

runners.cache.s3

runners.cache.gcs

runners.cache.azure

runners.docker

tls_verify = false

image = "harbor.xxx.com/base_image/alpine:latest"

privileged = false

disable_entrypoint_overwrite = false

oom_kill_disable = false

disable_cache = false

volumes = ["/data/gitlab-runner/builds:/builds","/data/gitlab-runner/cache:/cache","/var/run/docker.sock:/var/run/docker.sock"]

shm_size = 0

6.CI/CD Settings

Test coverage parsing: Statements.*?(\d+(?:\.\d+)?)%

7.Command

ng test --no-watch --code-coverage

sonar-scanner -Dproject.settings=sonar-project.properties

8.Reference

https://gitlab.xxx.com.cn/xxx/webapp-angular

相关推荐
yuhaiqun19891 小时前
Typora 技能进阶:从会写 Markdown 到玩转配置 + 插件高效学习笔记
经验分享·笔记·python·学习·学习方法·ai编程·markdown
宝宝单机sop1 小时前
产品经理资源合集
经验分享
Ronin3052 小时前
远程控制软件使用体验分享:2025年个人实测记录
经验分享·用户体验
隆道2 小时前
从地缘政治看供应链的风险链属性
经验分享·制造·数智化升级
LaughingZhu2 小时前
Product Hunt 每日热榜 | 2025-12-18
人工智能·经验分享·神经网络·搜索引擎·产品运营
北岛寒沫4 小时前
北京大学国家发展研究院 经济学辅修 经济学原理课程笔记(第八课 外部性)
经验分享·笔记
产品日记5 小时前
SAP报错处理:有关最后完成得会计年度的信息不完整
经验分享·sap·sap gr·group reporting
德思特5 小时前
德思特产品 | 弱网模拟与射频衰减终极指南:德思特如何以矩阵架构重塑通信设备测试
经验分享
Wpa.wk5 小时前
自动化测试 - 文件上传 和 弹窗处理
开发语言·javascript·自动化测试·经验分享·爬虫·python·selenium
狮子座的男孩6 小时前
html+css基础:07、css2的复合选择器_伪类选择器(概念、动态伪类、结构伪类(核心)、否定伪类、UI伪类、目标伪类、语言伪类)及伪元素选择器
前端·css·经验分享·html·伪类选择器·伪元素选择器·结构伪类