Skip to content

Commit

Permalink
CI: run nightly workflow really nightly only
Browse files Browse the repository at this point in the history
  • Loading branch information
kmilos committed Aug 8, 2023
1 parent e1c94a1 commit 392f106
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 28 deletions.
38 changes: 20 additions & 18 deletions .github/workflows/nightly_Linux_distributions.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand All @@ -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
20 changes: 10 additions & 10 deletions ci/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -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 install gcc-c++ clang cmake ninja-build 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"
Expand Down

0 comments on commit 392f106

Please sign in to comment.