matrixion/.gitlab-ci.yml

205 lines
8.1 KiB
YAML
Raw Permalink Normal View History

2020-05-01 02:27:27 +03:00
variables:
CCACHE_COMPILERCHECK: content
CCACHE_DIR: "${CI_PROJECT_DIR}/.ccache"
# prevent configure tzdata hanging apt install commands
DEBIAN_FRONTEND: noninteractive
build-gcc7:
stage: build
image: ubuntu:16.04
tags: [docker]
variables:
CXX: g++-7
CC: gcc-7
QT_PKG: 510
TRAVIS_OS_NAME: linux
before_script:
- apt-get update
- apt-get install -y software-properties-common
- add-apt-repository ppa:ubuntu-toolchain-r/test -y
- add-apt-repository ppa:beineri/opt-qt-5.10.1-xenial -y
- apt-get update && apt-get -y install --no-install-recommends g++-7 build-essential ninja-build qt${QT_PKG}{base,declarative,tools,multimedia,script,quickcontrols2,svg} liblmdb-dev libgl1-mesa-dev libssl-dev git ccache
# need recommended deps for wget
- apt-get -y install wget
- wget https://github.com/Kitware/CMake/releases/download/v3.19.0/cmake-3.19.0-Linux-x86_64.sh && sh cmake-3.19.0-Linux-x86_64.sh --skip-license --prefix=/usr/local
- /usr/sbin/update-ccache-symlinks
- update-alternatives --install /usr/bin/gcc gcc "/usr/bin/${CC}" 10
- update-alternatives --install /usr/bin/g++ g++ "/usr/bin/${CXX}" 10
- update-alternatives --set gcc "/usr/bin/${CC}"
- update-alternatives --set g++ "/usr/bin/${CXX}"
script:
- export PATH="/usr/lib/ccache:${PATH}"
- export CMAKE_BUILD_PARALLEL_LEVEL=$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l)
- export PATH="/usr/local/bin/:${PATH}"
- . "/opt/qt${QT_PKG}/bin/qt${QT_PKG}-env.sh" || true
- mkdir -p .deps/usr .hunter
- mkdir -p build
- cmake -GNinja -H. -Bbuild
-DCMAKE_INSTALL_PREFIX=.deps/usr
-DHUNTER_ROOT=".hunter"
-DHUNTER_ENABLED=ON -DBUILD_SHARED_LIBS=OFF -DUSE_BUNDLED_OPENSSL=ON -DUSE_BUNDLED_LMDB=OFF
2020-05-01 02:27:27 +03:00
-DCMAKE_BUILD_TYPE=Release -DHUNTER_CONFIGURATION_TYPES=Release
-DCI_BUILD=ON
- cmake --build build
cache:
key: "$CI_JOB_NAME"
paths:
- .hunter/
- .ccache
build-macos:
stage: build
tags: [macos]
before_script:
- brew update
2021-01-06 11:51:41 +03:00
- brew reinstall --force python3
- brew bundle --file=./.ci/macos/Brewfile --force --cleanup
2020-12-09 01:18:22 +03:00
- pip3 install dmgbuild
2020-05-01 02:27:27 +03:00
script:
- export PATH=/usr/local/opt/qt/bin/:${PATH}
- export CMAKE_PREFIX_PATH=/usr/local/opt/qt5
- cmake -GNinja -H. -Bbuild
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_INSTALL_PREFIX=.deps/usr
-DHUNTER_ROOT=".hunter"
-DHUNTER_ENABLED=ON -DBUILD_SHARED_LIBS=OFF
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DHUNTER_CONFIGURATION_TYPES=RelWithDebInfo
-DUSE_BUNDLED_OPENSSL=ON
-DUSE_BUNDLED_BOOST=ON
-DCI_BUILD=ON
- cmake --build build
2020-12-08 23:34:07 +03:00
after_script:
- ./.ci/macos/deploy.sh
2020-12-09 00:32:04 +03:00
- ./.ci/upload-nightly-gitlab.sh artifacts/nheko-${CI_COMMIT_SHORT_SHA}.dmg
2020-12-08 23:34:07 +03:00
artifacts:
paths:
2020-12-09 00:32:04 +03:00
- artifacts/nheko-${CI_COMMIT_SHORT_SHA}.dmg
name: nheko-${CI_COMMIT_SHORT_SHA}-macos
expose_as: 'macos-dmg'
2020-05-01 02:27:27 +03:00
cache:
key: "${CI_JOB_NAME}"
paths:
- .hunter/
- "${CCACHE_DIR}"
build-flatpak-amd64:
stage: build
image: ubuntu:latest
#image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master'
tags: [docker]
before_script:
2021-02-23 21:26:26 +03:00
- apt-get update && apt-get -y install flatpak-builder git python curl python3-aiohttp python3-tenacity gir1.2-ostree-1.0
2020-05-01 02:27:27 +03:00
- flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
2020-11-27 03:36:48 +03:00
- flatpak --noninteractive install --user flathub org.kde.Platform//5.15
- flatpak --noninteractive install --user flathub org.kde.Sdk//5.15
2020-05-01 02:27:27 +03:00
script:
- export VERSION=$(git describe)
- mkdir -p build-flatpak
- cd build-flatpak
- flatpak-builder --user --disable-rofiles-fuse --ccache --repo=repo --default-branch=${CI_COMMIT_REF_NAME//\//_} --subject="Build of Nheko ${VERSION} `date`" app ../io.github.NhekoReborn.Nheko.yaml
2021-01-11 01:45:10 +03:00
- flatpak build-bundle repo nheko-amd64.flatpak io.github.NhekoReborn.Nheko ${CI_COMMIT_REF_NAME//\//_}
2020-05-01 02:27:27 +03:00
after_script:
2021-02-23 21:26:26 +03:00
- (cd ./scripts && ./upload-to-flatpak-repo.sh ../build-flatpak/repo) || true
2020-05-01 02:27:27 +03:00
- bash ./.ci/upload-nightly-gitlab.sh build-flatpak/nheko-amd64.flatpak
cache:
key: "$CI_JOB_NAME"
paths:
- build-flatpak/.flatpak-builder/
artifacts:
expose_as: 'flatpak-amd64'
paths: ['build-flatpak/nheko-amd64.flatpak']
name: flatpak-${CI_COMMIT_REF_NAME}-${VERSION}-amd64
build-flatpak-arm64:
stage: build
image: ubuntu:latest
#image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master'
tags: [docker-arm64]
before_script:
2021-02-23 21:26:26 +03:00
- apt-get update && apt-get -y install flatpak-builder git python curl python3-aiohttp python3-tenacity gir1.2-ostree-1.0
2020-05-01 02:27:27 +03:00
- flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
2020-11-27 03:36:48 +03:00
- flatpak --noninteractive install --user flathub org.kde.Platform//5.15
- flatpak --noninteractive install --user flathub org.kde.Sdk//5.15
2020-05-01 02:27:27 +03:00
script:
- export VERSION=$(git describe)
- mkdir -p build-flatpak
- cd build-flatpak
- flatpak-builder --user --disable-rofiles-fuse --ccache --repo=repo --default-branch=${CI_COMMIT_REF_NAME//\//_} --subject="Build of Nheko ${VERSION} `date` for arm64" app ../io.github.NhekoReborn.Nheko.yaml
2021-01-11 01:45:10 +03:00
- flatpak build-bundle repo nheko-arm64.flatpak io.github.NhekoReborn.Nheko ${CI_COMMIT_REF_NAME//\//_}
2020-05-01 02:27:27 +03:00
after_script:
2021-02-23 21:26:26 +03:00
- (cd ./scripts && ./upload-to-flatpak-repo.sh ../build-flatpak/repo) || true
2020-05-01 02:27:27 +03:00
- bash ./.ci/upload-nightly-gitlab.sh build-flatpak/nheko-arm64.flatpak
cache:
key: "$CI_JOB_NAME"
paths:
- build-flatpak/.flatpak-builder/
artifacts:
expose_as: 'flatpak-arm64'
paths: ['build-flatpak/nheko-arm64.flatpak']
name: flatpak-${CI_COMMIT_REF_NAME}-${VERSION}-arm64
linting:
stage: build
image: alpine:latest
tags: [docker]
before_script:
2021-03-05 02:35:15 +03:00
- apk update && apk add clang make git python3 py3-pip
- export PATH="$PATH:/root/.local/bin"
- pip3 install --user reuse
2020-05-01 02:27:27 +03:00
script:
- make lint
2021-03-05 02:35:15 +03:00
- make license
2020-12-25 21:14:32 +03:00
appimage-amd64:
stage: build
image: appimagecrafters/appimage-builder
tags: [docker]
before_script:
# app build requirements
- echo 'deb http://archive.neon.kde.org/user/ bionic main' > /etc/apt/sources.list.d/neon.list
- wget -qO - https://archive.neon.kde.org/public.key | apt-key add -
- apt-get update
2020-12-26 05:48:08 +03:00
- apt-get install -y git wget curl
2020-12-25 21:14:32 +03:00
# update appimage-builder (optional)
- pip3 install --upgrade git+https://www.opencode.net/azubieta/appimagecraft.git
- apt-get install -y qt5-default qtdeclarative5-dev qttools5-dev qtscript5-dev qtquickcontrols2-5-dev qtmultimedia5-dev libqt5svg5-dev liblmdb-dev libssl-dev git ninja-build qt5keychain-dev libgtest-dev ccache
- wget https://github.com/Kitware/CMake/releases/download/v3.19.0/cmake-3.19.0-Linux-x86_64.sh && sh cmake-3.19.0-Linux-x86_64.sh --skip-license --prefix=/usr/local
- /usr/sbin/update-ccache-symlinks
script:
- export PATH="/usr/local/bin/:/usr/lib/ccache:${PATH}"
- export CMAKE_BUILD_PARALLEL_LEVEL=$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l)
- cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -GNinja
-DHUNTER_ROOT=".hunter"
-DHUNTER_ENABLED=ON -DBUILD_SHARED_LIBS=OFF
-DHUNTER_CONFIGURATION_TYPES=Release
-DUSE_BUNDLED_BOOST=ON
-DUSE_BUNDLED_SPDLOG=ON
-DUSE_BUNDLED_OLM=ON
-DUSE_BUNDLED_GTEST=OFF
-DUSE_BUNDLED_CMARK=ON
-DUSE_BUNDLED_JSON=ON
-DUSE_BUNDLED_OPENSSL=OFF
-DUSE_BUNDLED_MTXCLIENT=ON
-DUSE_BUNDLED_LMDB=OFF
-DUSE_BUNDLED_LMDBXX=ON
-DUSE_BUNDLED_TWEENY=ON
-DUSE_BUNDLED_QTKEYCHAIN=OFF
- DESTDIR=`pwd`/AppDir ninja -C build install/local
- DESTDIR=`pwd`/AppDir ninja -C build _deps/cmark-build/src/install
- mkdir -p AppDir/usr/lib/x86_64-linux-gnu AppDir/lib/x86_64-linux-gnu
- appimage-builder --skip-test
2020-12-26 05:48:08 +03:00
after_script:
- bash ./.ci/upload-nightly-gitlab.sh nheko-latest-x86_64.AppImage
2020-12-25 21:14:32 +03:00
artifacts:
paths:
2020-12-26 06:52:03 +03:00
- 'nheko-latest-x86_64.AppImage'
2020-12-25 21:14:32 +03:00
expire_in: 1 week
2020-12-26 06:52:03 +03:00
expose_as: 'appimage-amd64'
2020-12-25 21:14:32 +03:00
cache:
key: "$CI_JOB_NAME"
paths:
- .hunter/
- .ccache