|
23 | 23 | - anod build --latest gnatcoll-core |
24 | 24 |
|
25 | 25 | - echo "packaging $ANOD_DEFAULT_SANDBOX_DIR/$HOST/gnatcoll-core-current/install/" ; |
26 | | - - tar czf $CI_PROJECT_DIR/$pkg.tar.gz -C $ANOD_DEFAULT_SANDBOX_DIR/$HOST/gnatcoll-core-current/ install/ ; |
| 26 | + - tar czf $CI_PROJECT_DIR/gnatcoll-core-current.tar.gz -C $ANOD_DEFAULT_SANDBOX_DIR/$HOST/gnatcoll-core-current/ install/ ; |
27 | 27 | - cd $CI_PROJECT_DIR |
28 | 28 | - ls -l *.tar.gz |
29 | 29 |
|
|
66 | 66 | - test.xml |
67 | 67 | reports: |
68 | 68 | junit: test.xml |
| 69 | + |
| 70 | +build_and_test_coverage: |
| 71 | + services: |
| 72 | + - image:sandbox |
| 73 | + - cpu:8 |
| 74 | + - mem:16 |
| 75 | + stage: build |
| 76 | + script: |
| 77 | + - anybadge -l Coverage -v "Under Construction" -f coverage.svg -c steelblue |
| 78 | + - anybadge -l "Tests Passing" -v "Error" -f test-count.svg -c red |
| 79 | + |
| 80 | + - anod vcs --add-repo gnatcoll-core $CI_PROJECT_DIR |
| 81 | + - anod build --latest gnatcoll-core -Qcoverage |
| 82 | + - anod test --latest gnatcoll-core -Qcoverage |
| 83 | + # TODO: replace build space by something computed |
| 84 | + - e3-testsuite-report |
| 85 | + --failure-exit-code 1 |
| 86 | + --xunit-output $CI_PROJECT_DIR/test-coverage.xml |
| 87 | + --xunit-name gnatcoll-core |
| 88 | + $ANOD_DEFAULT_SANDBOX_DIR/$HOST/gnatcoll-core-current-test-cov/results/new/ || exit 1 |
| 89 | + |
| 90 | + # Create test count badge |
| 91 | + - cd $CI_PROJECT_DIR |
| 92 | + - rm test-count.svg # remove placeholder error badge |
| 93 | + - create_xunit_badge --xunit_reports test-coverage.xml |
| 94 | + |
| 95 | + # Move coverage reports and log coverage summaries |
| 96 | + - mkdir $CI_PROJECT_DIR/coverage |
| 97 | + - mv /it/wave/x86_64-linux/gnatcoll-core-current-test-cov/results/new/coverage-xml $CI_PROJECT_DIR/coverage/xml |
| 98 | + - mv /it/wave/x86_64-linux/gnatcoll-core-current-test-cov/results/new/coverage-dhtml $CI_PROJECT_DIR/coverage/dhtml |
| 99 | + - mv /it/wave/x86_64-linux/gnatcoll-core-current-test-cov/results/new/coverage-cobertura $CI_PROJECT_DIR/coverage/cobertura |
| 100 | + - echo_coverage_stats --coverage-file $CI_PROJECT_DIR/coverage/xml/index.xml |
| 101 | + |
| 102 | + # We previously prevented the pipeline from halting if a test failed, to make |
| 103 | + # sure all tests were run. If a test failed now we exit with a non-zero code |
| 104 | + - if [ ! -z ${FAILED+x} ]; then echo "There was at least one testcase failure" && exit 1; fi |
| 105 | + coverage: '/^Stmt Coverage:\s+(\d+\.\d+\%) \(\d+ \/ \d+\)$/' |
| 106 | + allow_failure: true |
| 107 | + artifacts: |
| 108 | + when: |
| 109 | + always |
| 110 | + paths: |
| 111 | + - $PACKAGE |
| 112 | + - test-coverage.xml |
| 113 | + - coverage.svg |
| 114 | + - test-count.svg |
| 115 | + - coverage/xml |
| 116 | + - coverage/dhtml |
| 117 | + - coverage/cobertura |
| 118 | + reports: |
| 119 | + junit: test-coverage.xml |
| 120 | + coverage_report: |
| 121 | + coverage_format: cobertura |
| 122 | + path: coverage/cobertura/cobertura.xml |
| 123 | + |
| 124 | + interruptible: true |
0 commit comments