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/.github/workflows/on_PR_linux_fuzz.yml b/.github/workflows/on_PR_linux_fuzz.yml index c2e14a32c3..3c1e28f4ab 100644 --- a/.github/workflows/on_PR_linux_fuzz.yml +++ b/.github/workflows/on_PR_linux_fuzz.yml @@ -21,13 +21,13 @@ jobs: steps: - uses: actions/checkout@v3 - - name: install dependencies + - name: Install dependencies run: | sudo ./ci/install_dependencies.sh - sudo apt-get install ninja-build - - name: build and compile + - name: Build env: + CC: clang CXX: clang++ run: | cmake --preset linux-sanitizers -S . -B build -DCMAKE_BUILD_TYPE=Release -DEXIV2_BUILD_FUZZ_TESTS=ON -DEXIV2_BUILD_UNIT_TESTS=OFF diff --git a/ci/install_dependencies.sh b/ci/install_dependencies.sh index 7a127af891..aa98275b60 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-build 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-build 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-build 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 samurai 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-build 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 --enablerepo=crb install meson + dnf -y install gcc-c++ clang cmake expat-devel zlib-devel brotli-devel libssh-devel libcurl-devel git + dnf -y --enablerepo=crb install ninja-build 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"