.gitlab-ci.yml 1.91 KB
Newer Older
1 2
stages:
  - test
3
  - deploy
4

5
flatpak:
6
    image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:3.28
7 8
    stage: test
    script:
9
        # Build the flatpak deps
10
        - flatpak-builder --stop-at=fractal app flatpak/org.gnome.Fractal.json
11 12

        # Force regeneration of gresources regardless of artifacts chage
13
        - flatpak-builder --run app flatpak/org.gnome.Fractal.json glib-compile-resources --sourcedir=fractal-gtk/res/ fractal-gtk/res/resources.xml
14

15 16 17 18
        - flatpak-builder --run app flatpak/org.gnome.Fractal.json meson --prefix=/app --libdir=/app/lib _build
        - flatpak-builder --run app flatpak/org.gnome.Fractal.json ninja -C _build install
        - flatpak-builder --finish-only app flatpak/org.gnome.Fractal.json
        - flatpak build-export repo app
19

20 21 22 23
        # Create a flatpak bundle for designers to use
        - flatpak build-bundle repo fractal-dev.flatpak org.gnome.Fractal
        # Run the tests
        - flatpak-builder --run app flatpak/org.gnome.Fractal.json cargo test
24

25 26 27 28
    artifacts:
        paths:
            - fractal-dev.flatpak
        expire_in: 2 days
29

30 31 32 33 34 35 36
    cache:
        # JOB_NAME - Each job will have it's own cache
        # ^ Keep diffrerent caches for each branch
        key: "$CI_JOB_NAME"
        paths:
          - .flatpak-builder/cache/
          - target/
37

38
pages:
39
    image: fedora
40 41 42
    stage: deploy
    only:
        - master
43 44
    before_script:
        - dnf install -y rust cargo meson make gtk3-devel gspell-devel openssl-devel gmp-devel
45
    script:
46 47 48 49 50
        # Setup the cargo cache
        - mkdir -p .cargo_cache
        - export CARGO_HOME="${PWD}/.cargo_cache"

        - cargo doc --no-deps
51 52 53 54 55 56
        - cargo rustdoc -p fractal-gtk -- --document-private-items
        - rm -rf public
        - mv target/doc/ public
    artifacts:
        paths:
          - public
57 58 59 60 61 62
    cache:
        key: "$CI_JOB_NAME"
        paths:
            - target/
            - .cargo_cache/