Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F114053
D72.1732503456.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.1732503456.diff
View Options
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,8 +10,13 @@
stages:
- prepare
- build
+ - coverage-vis
- report
+'coverage-report-html':
+ stage: coverage-vis
+ image: 'reg.lily.kazv.moe/infra/phorge-ci-tools/pycobertura:servant'
+
.report:
image:
name: 'reg.lily.kazv.moe/infra/phorge-ci-tools:servant'
@@ -22,14 +27,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 +43,51 @@
build-debug:
stage: build
image:
- name: 'ubuntu:21.04'
- script: |
- ./script.sh
+ name: 'ubuntu:20.04'
+ script:
+ - apt-get update
+ - DPKG_FRONTEND=noninteractive apt-get -y install g++
+ - 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-html':
+ 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 .
artifacts:
- <<: *defaultArtifacts
+ name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
paths:
- - testfile
- expire_in: 1 week
+ - build/coverage.html
-another:
- stage: build
- image:
- name: 'ubuntu:21.04'
- script: |
- export VAR=foo
- ./script.sh
- false
- artifacts:
- <<: *defaultArtifacts
- paths:
- - testfile
- expire_in: 1 week
+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-final:
+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
Sun, Nov 24, 6:57 PM (6 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40017
Default Alt Text
D72.1732503456.diff (3 KB)
Attached To
Mode
D72: Add coverage report
Attached
Detach File
Event Timeline
Log In to Comment