Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F112606
D72.1732338297.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D72.1732338297.diff
View Options
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,6 +10,8 @@
stages:
- prepare
- build
+ - coverage-vis
+ - upload-coverage-to-phorge
- report
.report:
@@ -22,14 +24,6 @@
before_script:
- pipelineUrl="$CI_PROJECT_URL"/-/pipelines/"$CI_PIPELINE_ID"
-default:
- after_script:
- - touch status.env
- - 'if [ "$CI_JOB_STATUS" != "success" ]; then echo FAILED=1 >> status.env; fi'
- artifacts: &defaultArtifacts
- reports:
- dotenv: status.env
-
prepare-env:
stage: prepare
script: |
@@ -46,46 +40,57 @@
build-debug:
stage: build
image:
- name: 'ubuntu:21.04'
- script: |
- ./script.sh
+ name: 'reg.lily.kazv.moe/kazv/libkazv-deps/deps:servant'
+ script:
+ - mkdir build
+ - cd build
+ - g++ -fprofile-arcs -ftest-coverage -fPIC -O0 -o hello ../hello.cpp
+ - ./hello
+ - gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml -r "${CI_PROJECT_DIR}" --object-directory .
+ coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
- <<: *defaultArtifacts
+ name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
paths:
- - testfile
- expire_in: 1 week
+ - build/coverage.xml
+ reports:
+ coverage_report:
+ coverage_format: cobertura
+ path: build/coverage.xml
-build-other:
- stage: build
- image:
- name: 'ubuntu:21.04'
- script: |
- ./script.sh
- false
+'coverage-report':
+ stage: coverage-vis
+ image: 'reg.lily.kazv.moe/infra/phorge-ci-tools/pycobertura:servant'
+ script:
+ - pycobertura show ./build/coverage.xml --format html --output ./build/coverage.html --source .
+ - /tools/cobertura-to-phorge ./build/coverage.xml . > ./build/coverage.json
artifacts:
- <<: *defaultArtifacts
+ name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
paths:
- - testfile
- expire_in: 1 week
+ - build/coverage.html
+ - build/coverage.json
-another:
- stage: build
- image:
- name: 'ubuntu:21.04'
- script: |
- export VAR=foo
- ./script.sh
- false
- artifacts:
- <<: *defaultArtifacts
- paths:
- - testfile
- expire_in: 1 week
+upload-coverage:
+ extends: .report
+ stage: upload-coverage-to-phorge
+ script:
+ - '{ echo "{\"receiver\": \"$TARGET_PHID\", \"type\": \"work\", \"unit\": [{\"name\": \"Test coverage\", \"result\": \"pass\", \"details\": \"$pipelineUrl\", \"format\": \"remarkup\", \"coverage\":"; cat build/coverage.json; echo "}]}"; } | /tools/arcanist/bin/arc call-conduit --conduit-uri https://iron.lily-is.land/ --conduit-token "$CONDUIT_TOKEN" -- harbormaster.sendmessage'
-report-final:
+report-success:
extends: .report
+ rules:
+ - if: $TARGET_PHID
+ when: on_success
+ - when: never
+ stage: report
+ script:
+ - 'echo "{\"receiver\": \"$TARGET_PHID\", \"type\": \"pass\"}" | /tools/arcanist/bin/arc call-conduit --conduit-uri https://iron.lily-is.land/ --conduit-token "$CONDUIT_TOKEN" -- harbormaster.sendmessage'
+
+report-failure:
+ extends: .report
+ rules:
+ - if: $TARGET_PHID
+ when: on_failure
+ - when: never
stage: report
script:
- - TYPE=pass
- - if [ -n "$FAILED" ]; then TYPE=fail; fi
- - 'echo "{\"receiver\": \"$TARGET_PHID\", \"type\": \"$TYPE\"}" | /tools/arcanist/bin/arc call-conduit --conduit-uri https://iron.lily-is.land/ --conduit-token "$CONDUIT_TOKEN" -- harbormaster.sendmessage'
+ - 'echo "{\"receiver\": \"$TARGET_PHID\", \"type\": \"fail\"}" | /tools/arcanist/bin/arc call-conduit --conduit-uri https://iron.lily-is.land/ --conduit-token "$CONDUIT_TOKEN" -- harbormaster.sendmessage'
diff --git a/hello.cpp b/hello.cpp
new file mode 100644
--- /dev/null
+++ b/hello.cpp
@@ -0,0 +1,11 @@
+#include <iostream>
+#include <string>
+
+int main(int argc, char *argv[])
+{
+ if (argv[0] == std::string("hello")) {
+ std::cout << "hello\n";
+ } else {
+ std::cout << "not hello\n";
+ }
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 9:04 PM (18 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39095
Default Alt Text
D72.1732338297.diff (3 KB)
Attached To
Mode
D72: Add coverage report
Attached
Detach File
Event Timeline
Log In to Comment