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

相关推荐
feasibility.11 小时前
SSH Agent Forwarding 与 tmux 排障笔记
linux·运维·服务器·经验分享·笔记·ssh
heartzZ1yy13 小时前
PolarCTF靶场 Crypto 简单 (上)
经验分享·笔记
凌峰的博客15 小时前
IEEE Transactions on Network Science and Engineering 期刊投稿经验
经验分享
赵谨言17 小时前
地球磁场干扰噪声减弱声波对抗测量系统研究进展:近十年中英文文献综述
大数据·开发语言·经验分享
Bdzbdq18 小时前
电压互感器为什么要配一次消谐器?
经验分享
大师影视解说18 小时前
短剧出海全流程实操:翻译工具怎么选?如何操作?
经验分享·ai翻译·短剧翻译·ai配音工具测评·ai配音技术·解说配音
LaughingZhu19 小时前
Product Hunt 每日热榜 | 2026-03-26
人工智能·经验分享·深度学习·神经网络·产品运营
森诺Alyson20 小时前
前沿技术借鉴研讨-2026.3.26(解决虚假特征x2/混合专家对比学习框架)
论文阅读·人工智能·经验分享·深度学习·学习·论文笔记
森诺Alyson20 小时前
前沿技术借鉴研讨-2026.3.19(睡眠分期/Agents模拟临床会诊/多模态抑郁症检测)
论文阅读·经验分享·深度学习·论文笔记·论文讨论
AI精钢21 小时前
从 Prompt Engineering 到 Harness Engineering:AI 系统竞争,正在从“会写提示词”转向“会搭执行框架”
人工智能·prompt·devops·ai agent·ai engineering