.gitlab-ci.yml 3.3 KB
Newer Older
1 2
stages:
    - build
3 4 5 6
    - deploy

variables:
    BUNDLE: "org.gnome.Evince.flatpak"
7

8 9
master:
    image: registry.gitlab.gnome.org/gnome/evince/master-amd64:latest
10 11
    stage: build

12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
    script:
        - ./autogen.sh --enable-debug --enable-nautilus
        - make

    artifacts:
        when: on_failure
        paths:
        - config.log
        expire_in: 2 days

meson:
    image: registry.gitlab.gnome.org/gnome/evince/master-amd64:latest
    stage: build
    when: manual

27
    script:
28 29
        - meson _build
        - ninja -C _build all
30 31 32 33

    artifacts:
        when: on_failure
        paths:
34
        - _build/meson-logs/meson-log.txt
35 36
        expire_in: 2 days

37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
meson-gtk-doc:
    image: registry.gitlab.gnome.org/gnome/evince/master-amd64:latest
    stage: build
    when: manual

    script:
        - meson -Dgtk_doc=true _build
        - ninja -C _build all libevdocument-doc libevview-doc evince-doc

    artifacts:
        when: on_failure
        paths:
        - _build/meson-logs/meson-log.txt
        expire_in: 2 days

52 53 54 55 56 57 58
gtk-doc:
    image: registry.gitlab.gnome.org/gnome/evince/master-amd64:latest
    stage: build
    when: manual

    script:
        - ./autogen.sh --enable-nautilus --enable-gtk-doc
59
        - make
60 61 62 63 64 65

    artifacts:
        when: on_failure
        paths:
        - config.log
        expire_in: 2 days
66 67 68 69

flatpak:
    image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master
    stage: build
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101

    variables:
        MANIFEST_PATH: "build-aux/flatpak/org.gnome.Evince.json"
        RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"
        FLATPAK_MODULE: "evince"
        MESON_ARGS: "-Dnautilus=false"
        APP_ID: "org.gnome.Evince"

    script:
        - flatpak-builder --stop-at=evince app ${MANIFEST_PATH}
        - flatpak build app meson --prefix=/app ${MESON_ARGS} _build
        - flatpak build app ninja -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
        - flatpak build-bundle _repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID}

    artifacts:
        paths:
            - ${BUNDLE}
            - _build/meson-logs/meson-log.txt
        expire_in: 2 days

    cache:
        paths:
            - .flatpak-builder/downloads
            - .flatpak-builder/git

deploy:
    stage: deploy

    dependencies:
102
        - flatpak
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136

    script:
        - echo "Generating flatpak deployment"

    artifacts:
        paths:
            - ${BUNDLE}
        expire_in: 2 days

    environment:
        name: deploy/$CI_COMMIT_REF_NAME
        url: https://gitlab.gnome.org/$CI_PROJECT_PATH/-/jobs/$CI_JOB_ID/artifacts/raw/${BUNDLE}
        on_stop: stop_deploy

    except:
        - tags
        # don't run on stable branches
        - /^gnome-\d-\d\d$/
        # No need to run on the upstream master branch either
        - master@GNOME/evince

stop_deploy:
    stage: deploy
    script:
        - echo "Stopping flatpak deployment"
    when: manual
    environment:
        name: deploy/$CI_COMMIT_REF_NAME
        action: stop
    except:
        - tags
        # don't run on stable branches
        - /^gnome-\d-\d\d$/
        # No need to run on the upstream master branch either
137
        - master@GNOME/evince