summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: b367dda109f0a84b49374114174a7c6c0220234e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
stages:
- test
- review

build-fedora:
  image: fedora:latest
  stage: test
  before_script:
    - dnf install -y redhat-rpm-config meson git cairo-devel clutter-devel clutter-gst3-devel clutter-gtk-devel gcc-c++ gettext gnome-desktop3-devel grilo-devel gsettings-desktop-schemas-devel gstreamer1-devel gstreamer1-plugins-base-devel gstreamer1-plugins-good gtk3-devel gtk-doc itstool libappstream-glib liberation-sans-fonts libpeas-devel lirc-devel meson pygobject3-devel pylint python3-devel totem-pl-parser-devel flatpak-builder xorg-x11-server-Xvfb
  script:
    - meson _build
    - G_MESSAGES_DEBUG=all xvfb-run -a -s "-screen 0 1024x768x24" ninja -C _build test
    - ninja -C _build install

variables:
    # Replace with your preferred file name of the resulting Flatpak bundle
    BUNDLE: "org.gnome.TotemDevel.flatpak"
    GIT_SUBMODULE_STRATEGY: normal

flatpak:
    image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master
    stage: test
    variables:
        # Replace with your manifest path
        MANIFEST_PATH: "flatpak/org.gnome.Totem.json"
        RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"
        # Replace with your application name, as written in the manifest
        FLATPAK_MODULE: "totem"
        # Make sure to keep this in sync with the Flatpak manifest, all arguments
        # are passed except the config-args because we build it ourselves
        MESON_ARGS: "-Denable-easy-codec-installation=no"
        DBUS_ID: "org.gnome.Totem"

    script:
        - flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}
        # Make sure to keep this in sync with the Flatpak manifest, all arguments
        # are passed except the config-args because we build it ourselves
        - flatpak build app meson --prefix=/app ${MESON_ARGS} _build
        - flatpak build app ninja -j1 -C _build install
        - flatpak-builder --finish-only --repo=repo app ${MANIFEST_PATH}
        # Run automatic tests inside the Flatpak env
        - xvfb-run -a -s "-screen 0 1024x768x24" flatpak build app ninja -C _build test
        # Generate a Flatpak bundle
        - flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${DBUS_ID}

    artifacts:
        paths:
            - ${BUNDLE}
            - _build/meson-logs/meson-log.txt
            - _build/meson-logs/testlog.txt
        expire_in: 30 days
    cache:
        paths:
             - .flatpak-builder/cache

review:
    stage: review
    dependencies:
        - flatpak
    script:
        - echo "Generating flatpak deployment"
    artifacts:
        paths:
            - ${BUNDLE}
        expire_in: 30 days
    environment:
        name: review/$CI_COMMIT_REF_NAME
        url: https://gitlab.gnome.org/$CI_PROJECT_PATH/-/jobs/$CI_JOB_ID/artifacts/raw/${BUNDLE}
        on_stop: stop_review

stop_review:
    stage: review
    script:
        - echo "Stopping flatpak deployment"
    when: manual
    environment:
        name: review/$CI_COMMIT_REF_NAME
        action: stop