.gitlab-ci.yml 2.05 KB
Newer Older
Adrien Plazas's avatar
Adrien Plazas committed
1
stages:
2 3 4
  - build
  - test
  - review
Adrien Plazas's avatar
Adrien Plazas committed
5

6 7 8 9
variables:
  BUNDLE: "gnome-games-git.flatpak"

flatpak:tests:
10
  image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master
11
  stage: test
12
  variables:
13
    MANIFEST_PATH: "flatpak/org.gnome.Games.UnitTests.yml"
Adrien Plazas's avatar
Adrien Plazas committed
14
  script:
15 16 17 18
    - flatpak-builder unit-tests ${MANIFEST_PATH}
    - xvfb-run -a -s "-screen 0 1024x768x24" flatpak-builder --run unit-tests ${MANIFEST_PATH} games-unit-tests
  cache:
    paths:
19 20
      - .flatpak-builder/downloads
      - .flatpak-builder/git
21

22
flatpak:app:
23
  image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master
24
  stage: build
25 26 27 28 29 30
  variables:
    MANIFEST_PATH: "flatpak/org.gnome.Games.json"
    RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"
    FLATPAK_MODULE: "gnome-games"
  script:
    - flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}
31
    - flatpak build app meson --prefix=/app -Dprofile=development ${MESON_ARGS} _build
Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
32
    - flatpak build app ninja -C _build install
Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
33
    - flatpak build app ninja -C _build test
34 35
    - flatpak build app mkdir -p /app/lib/libretro/extra.d
    - flatpak-builder --finish-only --repo=repo app ${MANIFEST_PATH}
36
    - flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} org.gnome.GamesDevel
Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
37

38 39 40
  artifacts:
    paths:
      - ${BUNDLE}
Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
41
      - _build/meson-logs/meson-log.txt
42
    expire_in: 30 days
43 44
  cache:
    paths:
45 46
      - .flatpak-builder/downloads
      - .flatpak-builder/git
47 48 49 50 51 52 53 54 55 56 57 58

review:
  stage: review
  dependencies:
    - flatpak:app
    - flatpak:tests
  script:
    - echo "Generating flatpak deployment"
  artifacts:
    paths:
      - ${BUNDLE}
    expire_in: 30 days
59 60 61
  environment:
    name: review/$CI_COMMIT_REF_NAME
    url: https://gitlab.gnome.org/$CI_PROJECT_PATH/-/jobs/$CI_JOB_ID/artifacts/raw/${BUNDLE}
62
    on_stop: stop_review
63 64 65
  except:
    - master@GNOME/gnome-games
    - tags
66 67 68 69 70 71 72 73 74

stop_review:
  stage: review
  script:
    - echo "Stopping flatpak deployment"
  when: manual
  environment:
    name: review/$CI_COMMIT_REF_NAME
    action: stop
75 76 77
  except:
    - master@GNOME/gnome-games
    - tags