From 58c841fb17e465543593dbb3edebb79151657a0c 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 | 16 ++++---- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/.github/workflows/nightly_Linux_distributions.yml b/.github/workflows/nightly_Linux_distributions.yml index cebc027d5d..c87badb943 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 $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..1539a11110 100755 --- a/ci/install_dependencies.sh +++ b/ci/install_dependencies.sh @@ -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 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 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 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 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 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 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 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 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"