From 606f498e047f66d86846b1d463aca0c503d3f39f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Komar=C4=8Devi=C4=87?= Date: Tue, 8 Aug 2023 16:05:36 +0200 Subject: [PATCH] CI: run nightly workflow really nightly only --- .../workflows/nightly_Linux_distributions.yml | 38 ++++++++++--------- ci/install_dependencies.sh | 20 +++++----- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/.github/workflows/nightly_Linux_distributions.yml b/.github/workflows/nightly_Linux_distributions.yml index cebc027d5d..7dbd059e9d 100644 --- a/.github/workflows/nightly_Linux_distributions.yml +++ b/.github/workflows/nightly_Linux_distributions.yml @@ -1,10 +1,10 @@ on: - pull_request: - paths-ignore: - - "*.md" - workflow_dispatch: schedule: - - cron: 0 4 * * * + - cron: 0 4 * * * + workflow_dispatch: + +permissions: + contents: read concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -14,28 +14,30 @@ name: Nightly - Linux distributions jobs: distros: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: container_image: ["fedora", "debian", "archlinux", "ubuntu", "tgagor/centos", "alpine"] - compiler: [g++, clang++] + compiler: + - { CC: gcc, CXX: g++ } + - { CC: clang, CXX: clang++ } build_type: [Release, Debug] shared_libraries: [ON, OFF] container: image: ${{ matrix.container_image }} env: - CXX: ${{matrix.compiler}} - CMAKE_FLAGS: -DEXIV2_TEAM_EXTRA_WARNINGS=OFF -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_ENABLE_CURL=ON -DEXIV2_BUILD_UNIT_TESTS=OFF -DEXIV2_ENABLE_BMFF=ON -DEXIV2_TEAM_WARNINGS_AS_ERRORS=OFF -DEXIV2_ENABLE_PNG=ON -DCMAKE_INSTALL_PREFIX=install + CC: ${{ matrix.compiler.CC }} + CXX: ${{ matrix.compiler.CXX }} + CMAKE_FLAGS: -DEXIV2_TEAM_EXTRA_WARNINGS=OFF -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_ENABLE_CURL=ON -DEXIV2_BUILD_UNIT_TESTS=OFF -DEXIV2_TEAM_WARNINGS_AS_ERRORS=OFF -DCMAKE_INSTALL_PREFIX=install steps: - - uses: actions/checkout@v3 - - name: install dependencies - run: ./ci/install_dependencies.sh - - name: build and compile - run: | - mkdir build && cd build - cmake $CMAKE_FLAGS -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_SHARED_LIBS=${{ matrix.shared_libraries }} .. - cmake --build . --parallel - cmake --install . + - uses: actions/checkout@v3 + - name: Install dependencies + run: ./ci/install_dependencies.sh + - name: Build and install + run: | + cmake -GNinja $CMAKE_FLAGS -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_SHARED_LIBS=${{ matrix.shared_libraries }} -S . -B build + cmake --build build --parallel + cmake --install build diff --git a/ci/install_dependencies.sh b/ci/install_dependencies.sh index 7a127af891..8acbc3f958 100755 --- a/ci/install_dependencies.sh +++ b/ci/install_dependencies.sh @@ -8,8 +8,8 @@ debian_build_gtest() { [ -d gtest_build ] || mkdir gtest_build cd gtest_build - cmake -DBUILD_SHARED_LIBS=1 /usr/src/googletest/googletest - make + cmake -GNinja -DBUILD_SHARED_LIBS=1 /usr/src/googletest/googletest + cmake --build . if [ -f "lib/libgtest.so" ]; then # Ubuntu 20.04 with gtest 1.10 cp lib/libgtest* /usr/lib/ @@ -41,46 +41,46 @@ distro_id=$(grep '^ID=' /etc/os-release|awk -F = '{print $2}'|sed 's/\"//g') case "$distro_id" in 'fedora') - dnf -y --refresh install gcc-c++ clang cmake make expat-devel zlib-devel brotli-devel libssh-devel libcurl-devel gmock-devel which dos2unix glibc-langpack-en diffutils inih-devel + dnf -y --refresh install gcc-c++ clang cmake ninja expat-devel zlib-devel brotli-devel libssh-devel libcurl-devel gmock-devel glibc-langpack-en inih-devel ;; 'debian') apt-get update - apt-get install -y cmake g++ clang make libexpat1-dev zlib1g-dev libbrotli-dev libssh-dev libcurl4-openssl-dev libgmock-dev libxml2-utils libinih-dev + apt-get install -y cmake ninja g++ clang libexpat1-dev zlib1g-dev libbrotli-dev libssh-dev libcurl4-openssl-dev libgmock-dev libxml2-utils libinih-dev # debian_build_gtest ;; 'arch') pacman --noconfirm -Syu - pacman --noconfirm --needed -S gcc clang cmake make expat zlib brotli libssh curl gtest dos2unix which diffutils libinih + pacman --noconfirm --needed -S gcc clang cmake ninja expat zlib brotli libssh curl gtest libinih ;; 'ubuntu') apt-get update - apt-get install -y cmake g++ clang make libexpat1-dev zlib1g-dev libbrotli-dev libssh-dev libcurl4-openssl-dev libgmock-dev libxml2-utils libinih-dev + apt-get install -y cmake ninja g++ clang libexpat1-dev zlib1g-dev libbrotli-dev libssh-dev libcurl4-openssl-dev libgmock-dev libxml2-utils libinih-dev # debian_build_gtest ;; 'alpine') apk update - apk add gcc g++ clang cmake make expat-dev zlib-dev brotli-dev libssh-dev curl-dev gtest gtest-dev gmock libintl gettext-dev which dos2unix bash libxml2-utils diffutils inih-dev inih-inireader-dev + apk add gcc g++ clang cmake ninja expat-dev zlib-dev brotli-dev libssh-dev curl-dev gtest gtest-dev gmock libintl gettext-dev libxml2-utils inih-dev inih-inireader-dev ;; 'rhel') dnf clean all - dnf -y install gcc-c++ clang cmake make expat-devel zlib-devel brotli-devel libssh-devel libcurl-devel which dos2unix inih-devel + dnf -y install gcc-c++ clang cmake ninja expat-devel zlib-devel brotli-devel libssh-devel libcurl-devel inih-devel ;; 'centos') dnf clean all - dnf -y install gcc-c++ clang cmake make expat-devel zlib-devel brotli-devel libssh-devel libcurl-devel which dos2unix git + dnf -y install gcc-c++ clang cmake ninja expat-devel zlib-devel brotli-devel libssh-devel libcurl-devel dnf -y --enablerepo=crb install meson centos_build_inih ;; 'opensuse-tumbleweed') zypper --non-interactive refresh - zypper --non-interactive install gcc-c++ clang cmake make libexpat-devel zlib-devel libbrotli-devel libssh-devel libcurl-devel gmock which dos2unix libxml2-tools libinih-devel + zypper --non-interactive install gcc-c++ clang cmake ninja libexpat-devel zlib-devel libbrotli-devel libssh-devel libcurl-devel gmock libxml2-tools libinih-devel ;; *) echo "Sorry, no predefined dependencies for your distribution $distro_id exist yet"