ci: Replace scanbuild and coverage jobs with the template
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/584>
This commit is contained in:
+11
-39
@@ -7,6 +7,12 @@ include:
|
||||
inputs:
|
||||
dist-job-name: "build-flatpak"
|
||||
tarball-artifact-path: "${TARBALL_ARTIFACT_PATH}"
|
||||
- component: "gitlab.gnome.org/gnome/citemplates/gnomeos-basic-ci@master"
|
||||
inputs:
|
||||
meson-options: "-Dtracing=true -Dprofile=development"
|
||||
asan: "disabled"
|
||||
ubsan: "disabled"
|
||||
lsan: "disabled"
|
||||
|
||||
variables:
|
||||
APP_ID: "org.gnome.Calendar.Devel"
|
||||
@@ -61,49 +67,15 @@ nightly-aarch64:
|
||||
needs: ['build-flatpak-aarch64']
|
||||
when: manual
|
||||
|
||||
coverage:
|
||||
stage: analysis
|
||||
image: quay.io/gnome_infrastructure/gnome-build-meta:core-nightly
|
||||
needs:
|
||||
- job: build-flatpak
|
||||
artifacts: false
|
||||
script:
|
||||
- .gitlab-ci/install-grcov.sh
|
||||
- .gitlab-ci/build-with-coverage.sh
|
||||
- .gitlab-ci/gen-coverage.sh
|
||||
coverage: '/Coverage: \d+\.\d+/'
|
||||
artifacts:
|
||||
name: "gnome-calendar-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||
expire_in: 2 days
|
||||
when: always
|
||||
reports:
|
||||
coverage_report:
|
||||
coverage_format: cobertura
|
||||
path: public/coverage.xml
|
||||
paths:
|
||||
- "_build/meson-logs"
|
||||
- public
|
||||
|
||||
static-scan:
|
||||
stage: analysis
|
||||
image: quay.io/gnome_infrastructure/gnome-build-meta:core-nightly
|
||||
needs:
|
||||
- job: build-flatpak
|
||||
artifacts: false
|
||||
script:
|
||||
- .gitlab-ci/build-static-scan.sh
|
||||
artifacts:
|
||||
name: "gnome-calendar-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
paths:
|
||||
- "_build/meson-logs"
|
||||
- public
|
||||
|
||||
pages:
|
||||
stage: deploy
|
||||
needs: [ coverage, static-scan ]
|
||||
needs: [ "build-gnomeos-grcov-c", "build-gnomeos-scan-build" ]
|
||||
script:
|
||||
- mkdir -p public
|
||||
- cp .gitlab-ci/landing-page.html public/index.html
|
||||
- mv public_scanbuild/ public/scanbuild
|
||||
- mv public_grcov/coverage.xml public/
|
||||
- mv public_grcov/coverage public/coverage
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eux -o pipefail
|
||||
|
||||
meson setup --buildtype=debug --prefix /usr _scan_build .
|
||||
ninja -C _scan_build scan-build
|
||||
mkdir -p public/
|
||||
|
||||
# The scan-build command creates _scan_build/meson-logs/scanbuild/UUID which is ugly,
|
||||
# so we copy it to a friendly name instead.
|
||||
cp -r _scan_build/meson-logs/scanbuild/* public/scanbuild
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eux -o pipefail
|
||||
|
||||
export CFLAGS="-coverage -ftest-coverage -fprofile-arcs"
|
||||
|
||||
meson setup --buildtype=debug --prefix /usr _build .
|
||||
meson compile -C _build
|
||||
meson test -C _build
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eux -o pipefail
|
||||
|
||||
mkdir -p public
|
||||
grcov _build --source-dir ./ --prefix-dir ../ --output-type cobertura --branch --ignore-not-existing -o public/coverage.xml
|
||||
grcov _build --source-dir ./ --prefix-dir ../ --output-type html --branch --ignore-not-existing -o public/coverage
|
||||
|
||||
# Print "Coverage: 42.42" so .gitlab-ci.yml will pick it up with a regex
|
||||
#
|
||||
# We scrape this from the HTML report, not the JSON summary, because coverage.json
|
||||
# uses no decimal places, just something like "42%".
|
||||
|
||||
grep -Eo 'abbr title.* %' public/coverage/index.html | head -n 1 | grep -Eo '[0-9.]+ %' | grep -Eo '[0-9.]+' | awk '{ print "Coverage:", $1 }'
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eux -o pipefail
|
||||
|
||||
wget https://github.com/mozilla/grcov/releases/download/v0.10.0/grcov-x86_64-unknown-linux-gnu.tar.bz2
|
||||
tar xvf grcov-x86_64-unknown-linux-gnu.tar.bz2
|
||||
mkdir -p /usr/local/bin
|
||||
mv grcov /usr/local/bin/grcov
|
||||
|
||||
Reference in New Issue
Block a user