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

相关推荐
小飞程序员4 天前
Docker本地部署gitlab实践(windows,linux)
devops
一个人旅程~5 天前
如何用命令行把win10/win11设置为长期暂停更新?
linux·windows·经验分享·电脑
Factory_Audit5 天前
亚马逊社会责任验厂审核标准及注意事项
大数据·经验分享
江南小书生5 天前
制造业系统赋能成熟度自测表(实操版)
经验分享·非标制造
三流架构师5 天前
述职报告资源合集
经验分享
牛奶咖啡135 天前
DevOps自动化运维实践_使用再生龙对Linux系统进行备份还原
运维·自动化·devops·linux系统的备份还原·linux系统克隆备份·再生龙
徐先生 @_@|||5 天前
时间序列异常检测框架CrossAD论文阅读
经验分享·python·机器学习
LaughingZhu5 天前
Product Hunt 每日热榜 | 2026-02-25
数据库·人工智能·经验分享·神经网络·chatgpt
中屹指纹浏览器5 天前
2026 硬核技术实践:浏览器指纹生成算法与风控逆向对抗
经验分享·笔记
给老吕螺丝5 天前
提升国内访问GitHub稳定性的解决方案:Steamcommunity 302工具详解 (Ver.13.0.05+)
经验分享·github