# -*- indent-tabs-mode: nil -*- include: - local: 'ci/container_builds.yml' # Enable merge request pipelines and avoid duplicate pipelines # https://docs.gitlab.com/ee/ci/yaml/index.html#switch-between-branch-pipelines-and-merge-request-pipelines workflow: rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push" when: never - if: '$CI_COMMIT_TAG' - if: '$CI_COMMIT_BRANCH' variables: LIBRSVG_DEBUG: "yes" # Turn compiler warnings into errors RUSTFLAGS: '-D warnings' stages: - container-build - check - build - lint - analysis - acceptance test - docs default: interruptible: true check: extends: - '.container.opensuse@x86_64.stable' - '.fdo.distribution-image@opensuse' - '.cache_push' stage: check needs: ['opensuse-container@x86_64.stable'] script: - cargo check --all-targets --workspace cargo_test: stage: check extends: - '.container.opensuse@x86_64.stable' - '.fdo.distribution-image@opensuse' # Tests require extra crates, hence cache is pushed - '.cache_push' needs: - job: check artifacts: when: 'on_failure' paths: - tests/output expire_in: 1 day variables: TESTS_OUTPUT_DIR: "${CI_PROJECT_DIR}/tests/output" script: - cargo test --workspace -- --skip loading_crash --skip reference --skip render_crash .cargo-test: extends: '.cache' stage: build script: - cargo test --workspace artifacts: when: 'on_failure' paths: - tests/output expire_in: 1 day variables: TESTS_OUTPUT_DIR: "${CI_PROJECT_DIR}/tests/output" .build-rsvg-no-docs: extends: '.cache' stage: build variables: TESTS_OUTPUT_DIR: "${CI_PROJECT_DIR}/_build/tests/output" script: - mkdir -p _build - cd _build - ../autogen.sh --disable-gtk-doc --enable-vala - make - make check artifacts: when: 'on_failure' paths: - _build/tests/*.log - _build/tests/output expire_in: 1 day .build-rsvg-full: extends: '.cache' stage: build variables: TESTS_OUTPUT_DIR: "${CI_PROJECT_DIR}/_build/tests/output" script: - mkdir -p _build - cd _build - ../autogen.sh --enable-gtk-doc --enable-vala - make - make check artifacts: when: 'always' paths: - _build/doc/ - _build/tests/*.log - _build/tests/output expire_in: 1 day autotools build - opensuse@x86_64.stable: extends: - '.container.opensuse@x86_64.stable' - .fdo.distribution-image@opensuse - .build-rsvg-full # make check runs extra tests that require extra crates, hence cache is pushed - .cache_push needs: - job: opensuse-container@x86_64.stable artifacts: false - job: check artifacts: false cargo test - opensuse@x86_64.minimum: extends: - '.container.opensuse@x86_64.minimum' - .fdo.distribution-image@opensuse - .cargo-test needs: - job: opensuse-container@x86_64.minimum artifacts: false - job: check artifacts: false cargo test - opensuse@x86_64.nightly: extends: - '.container.opensuse@x86_64.nightly' - .fdo.distribution-image@opensuse - .cargo-test needs: - job: opensuse-container@x86_64.nightly artifacts: false - job: check artifacts: false cargo test - opensuse@aarch64: extends: - .container.opensuse@aarch64 - .fdo.distribution-image@opensuse - .cargo-test needs: - job: opensuse-container@aarch64 artifacts: false - job: check artifacts: false # The tests fail on aarch64 - some rendering differences. Needs diagnosis. allow_failure: true cargo test - fedora@x86_64: extends: - .container.fedora@x86_64 - .fdo.distribution-image@fedora - .cargo-test needs: - job: fedora-container@x86_64 artifacts: false - job: check artifacts: false .build-rsvg-fedora@aarch64: extends: - .container.fedora@aarch64 - .fdo.distribution-image@fedora - .build-rsvg-no-docs needs: - job: fedora-container@aarch64 artifacts: false - job: check artifacts: false rules: - if: '$CI_PIPELINE_SOURCE == "push"' when: manual allow_failure: true - if: '$CI_PIPELINE_SOURCE == "schedule"' .build-rsvg-debian@x86_64: extends: - '.container.debian@x86_64' - '.fdo.distribution-image@debian' - '.build-rsvg-no-docs' variables: # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=907306 # export GDK_PIXBUF_QUERYLOADERS=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders GDK_PIXBUF_QUERYLOADERS: '/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders' LIBRSVG_DEBUG: "no" needs: - job: debian-container@x86_64 artifacts: false - job: check artifacts: false rules: - if: '$CI_PIPELINE_SOURCE == "push"' when: manual allow_failure: true - if: '$CI_PIPELINE_SOURCE == "schedule"' .build-rsvg-debian@aarch64: extends: - '.container.debian@aarch64' - '.fdo.distribution-image@debian' - '.build-rsvg-no-docs' variables: # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=907306 # export GDK_PIXBUF_QUERYLOADERS=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders GDK_PIXBUF_QUERYLOADERS: '/usr/lib/aarch64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders' LIBRSVG_DEBUG: "no" needs: - job: debian-container@aarch64 artifacts: false - job: check artifacts: false rules: - if: '$CI_PIPELINE_SOURCE == "push"' when: manual allow_failure: true - if: '$CI_PIPELINE_SOURCE == "schedule"' .cache: variables: # Only stuff inside the repo directory can be cached # Override the CARGO_HOME variable to force its location CARGO_HOME: "${CI_PROJECT_DIR}/cargo_cache" before_script: - source ./ci/env.sh - mkdir -p cargo_cache cache: key: files: - Cargo.lock paths: # Rust cache # https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci - cargo_cache/bin - cargo_cache/registry/index - cargo_cache/registry/cache - cargo_cache/git/db policy: pull .cache_push: extends: .cache cache: policy: pull-push fmt: extends: - '.container.opensuse@x86_64.stable' - '.fdo.distribution-image@opensuse' - '.cache' stage: lint needs: - job: check script: - cargo fmt --all -- --check clippy: extends: - '.container.opensuse@x86_64.stable' - '.fdo.distribution-image@opensuse' - '.cache' stage: lint needs: - job: check script: - cargo clippy --version - gitlab-clippy --version - cargo clippy - cargo clippy --message-format=json | gitlab-clippy -o gl-code-quality-report.json artifacts: reports: codequality: gl-code-quality-report.json expire_in: 1 week rules: - if: '$CODE_QUALITY_DISABLED' when: never - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - if: '$CI_COMMIT_TAG' - if: '$CI_COMMIT_BRANCH' deny: extends: - '.container.opensuse@x86_64.stable' - '.fdo.distribution-image@opensuse' - '.cache' stage: lint needs: - job: check artifacts: false script: - cargo deny check check_versions: extends: - '.container.opensuse@x86_64.stable' - '.fdo.distribution-image@opensuse' stage: lint script: - python3 ci/check_project_version.py - python3 ci/check_rust_versions.py coverage: extends: - '.container.opensuse@x86_64.stable' - .fdo.distribution-image@opensuse - .cache stage: analysis needs: - job: opensuse-container@x86_64.stable - job: check artifacts: false script: - source ./ci/env.sh - bash -x ./ci/build-with-coverage.sh - bash -x ./ci/gen-coverage.sh coverage: '/Coverage: \d+\.\d+/' artifacts: name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA} expire_in: 2 days when: always # Disable the cobertura report for now; it is only used for showing coverage # in the diff view of merge requests. # # After switching to gcov-based instrumentation (-Zprofile above), this # coverage.xml is almost 500 MB and causes gitlab's redis to OOM. # # reports: # coverage_report: # coverage_format: cobertura # path: coverage.xml paths: - public cargo_bench: extends: - '.container.opensuse@x86_64.stable' - '.fdo.distribution-image@opensuse' - '.cache' stage: analysis needs: - job: check script: | BENCHES=("box_blur" "composite" "lighting" "path_parser" "pixbuf_from_surface" "pixel_iterators" "pixel_ops" "srgb" "surface_from_pixbuf") git checkout ${CI_DEFAULT_BRANCH} for BENCH in "${BENCHES[@]}" do cargo bench --bench $BENCH -- --noplot --save-baseline main done git checkout ${CI_COMMIT_SHA} for BENCH in "${BENCHES[@]}" do cargo bench --bench $BENCH -- --noplot --baseline main cargo bench --profile overflow --bench $BENCH -- --noplot --baseline main done rules: - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH != "main"' when: manual allow_failure: true artifacts: paths: - target/criterion expire_in: 1 week msys2-mingw64: stage: acceptance test tags: - win32-ps needs: - job: check variables: MSYSTEM: "MINGW64" CHERE_INVOKING: "yes" script: - C:\msys64\usr\bin\pacman --noconfirm -Syyuu - C:\msys64\usr\bin\bash -lc "bash -x ./ci/test-msys2.sh" artifacts: when: 'on_failure' paths: - _build\tests\*.log - _build\tests\output expire_in: 1 day vs2017-x64: # TODO: Uncomment this when ready to merge. # rules: # - if: $CI_PROJECT_NAMESPACE == "GNOME" stage: build tags: - win32-ps needs: [] script: - ci/test-msvc.bat artifacts: when: always paths: - "${CI_PROJECT_DIR}/_build/meson-logs" distcheck: stage: acceptance test extends: - '.container.opensuse@x86_64.stable' - '.fdo.distribution-image@opensuse' - '.cache' needs: - job: check artifacts: false variables: DESTDIR: "/tmp/distcheck" LIBRSVG_DEBUG: "no" script: - ./autogen.sh --enable-vala - make distcheck artifacts: when: 'on_success' paths: - librsvg-*.tar.xz expire_in: 1 week reference: stage: docs needs: - job: autotools build - opensuse@x86_64.stable artifacts: true script: - mkdir -p public/ - mv _build/doc/Rsvg-2.0 public/ artifacts: paths: - public expire_in: 1 day devel-docs: extends: - '.container.opensuse@x86_64.stable' - '.fdo.distribution-image@opensuse' - '.cache' stage: docs needs: - job: opensuse-container@x86_64.stable artifacts: false script: - bash -x ./ci/gen-devel-docs.sh artifacts: paths: - public expire_in: 1 day pages: stage: docs extends: - '.container.opensuse@x86_64.stable' - '.fdo.distribution-image@opensuse' - '.cache' needs: - job: reference - job: coverage - job: devel-docs script: - mkdir -p public/internals - cargo doc --workspace --document-private-items --no-deps - cp -r target/doc/* public/internals - mkdir -p public/doc - cargo doc --no-deps --package librsvg - cp -r target/doc/* public/doc artifacts: paths: - public expire_in: 1 day rules: - if: '$CI_COMMIT_BRANCH == "main"'