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

相关推荐
YGY Webgis糕手之路2 小时前
OpenLayers 综合案例-轨迹回放
前端·经验分享·笔记·vue·web
ONETHING_CLOUD_26 小时前
不用电脑要不要关机?
经验分享·科技·电脑·数码·实用技巧分享
YGY Webgis糕手之路7 小时前
OpenLayers 快速入门(九)Extent 介绍
前端·经验分享·笔记·vue·web
Azure DevOps13 小时前
在Azure DevOps的工作项中使用markdown
运维·microsoft·flask·azure·devops
先做个垃圾出来………13 小时前
CI/CD与DevOps集成方法
运维·ci/cd·devops
技术思考者17 小时前
基础很薄弱如何规划考研
java·经验分享·考研
Dream Algorithm1 天前
CT、IT、ICT 和 DICT区别
经验分享·信息与通信
人生都在赌1 天前
AI Agent从工具到生态的秘密:我们踩过的坑和3个月实践教训
人工智能·ci/cd·devops
人生都在赌1 天前
一个AI工作流如何让代码审查从手动到智能?实战拆解
ai编程·devops·cursor
梅羽落1 天前
谷歌无法安装扩展程序解决方法(也许成功)
经验分享