Browse Source

ci: Run Rust tests in a separate job

fractal-8
Kévin Commaille 2 years ago
parent
commit
7ba4b0b980
No known key found for this signature in database
GPG Key ID: C971D9DBC9D678D
  1. 5
      .gitlab-ci/nextest.toml
  2. 66
      .gitlab-ci/org.gnome.Fractal.CiRust.yml
  3. 16
      .gitlab-ci/test.yml
  4. 8
      src/meson.build

5
.gitlab-ci/nextest.toml

@ -0,0 +1,5 @@
[profile.default]
fail-fast = false
[profile.default.junit]
path = "junit.xml"

66
.gitlab-ci/org.gnome.Fractal.CiRust.yml

@ -0,0 +1,66 @@
id: org.gnome.Fractal.CiRust
runtime: org.gnome.Platform
runtime-version: master
sdk: org.gnome.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
- org.freedesktop.Sdk.Extension.llvm18
command: fractal
finish-args:
- --socket=fallback-x11
- --socket=wayland
- --socket=pulseaudio
- --share=network
- --share=ipc
- --device=dri
build-options:
append-ld-library-path: /usr/lib/sdk/llvm18/lib
append-path: /usr/lib/sdk/llvm18/bin:/usr/lib/sdk/rust-stable/bin
env:
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: -C link-arg=-fuse-ld=/usr/lib/sdk/rust-stable/bin/mold --cfg=ruma_identifiers_storage="Arc"
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: clang
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: -C link-arg=-fuse-ld=/usr/lib/sdk/rust-stable/bin/mold --cfg=ruma_identifiers_storage="Arc"
build-args:
- --share=network
test-args:
- --socket=x11
- --share=network
modules:
- name: cargo-nextest
buildsystem: simple
sources:
- type: archive
url: https://github.com/nextest-rs/nextest/releases/download/cargo-nextest-0.9.72/cargo-nextest-0.9.72-x86_64-unknown-linux-gnu.tar.gz
sha256: e6f66397d3ba9a150b5debbc414a9ad1f87e4707da1f989c0681444ba5d15571
dest: cargo-nextest
strip-components: 0
build-commands:
- mkdir /app/bin
- mv cargo-nextest/cargo-nextest /app/bin/
- name: protobuf-c
buildsystem: autotools
config-opts:
- --disable-protoc
sources:
- type: git
url: https://github.com/protobuf-c/protobuf-c.git
tag: v1.5.0
commit: 8c201f6e47a53feaab773922a743091eb6c8972a
- name: libshumate
buildsystem: meson
config-opts:
- -Dgir=false
- -Dvapi=false
- -Dgtk_doc=false
- -Dvector_renderer=true
sources:
- type: git
url: https://gitlab.gnome.org/GNOME/libshumate.git
tag: 1.2.2
commit: fab290f36bb7043fe6107308ff4f91c80492aa11
- name: fractal
buildsystem: meson
sources:
- type: dir
path: ../

16
.gitlab-ci/test.yml

@ -17,6 +17,22 @@ lint-metainfo:
- appstreamcli validate --pedantic --explain --strict ${METAINFO}
needs: ["build@x86_64"]
# Run the Rust tests.
rust-tests:
stage: test
image: 'quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master'
tags:
- flatpak
variables:
MANIFEST_PATH: ".gitlab-ci/org.gnome.Fractal.CiRust.yml"
script:
- flatpak-builder --keep-build-dirs --user --disable-rofiles-fuse --stop-at=${FLATPAK_MODULE} flatpak_app --repo=repo ${BRANCH:+--default-branch=$BRANCH} ${MANIFEST_PATH}
- echo "cargo-nextest nextest run --config-file ../.gitlab-ci/nextest.toml" | flatpak-builder --disable-rofiles-fuse --build-shell=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH}
dependencies: []
artifacts:
reports:
junit: '.flatpak-builder/build/${FLATPAK_MODULE}/target/nextest/default/junit.xml'
# Test that there are no errors in the docs.
build-docs:
extends:

8
src/meson.build

@ -106,11 +106,3 @@ custom_target(
cargo_options + doc_deps + ['--no-deps', '-Zrustdoc-map'] ,
],
)
test(
'cargo-test', cargo,
env: cargo_env,
args: ['test', '--no-fail-fast'] + cargo_options,
timeout: 0,
verbose: true,
)

Loading…
Cancel
Save