From d30542306f4d96411915494fa2c9b6d1f3475175 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 3 Oct 2024 17:58:42 +0200 Subject: [PATCH] CI: test -DEMBED_RESOURCE_FILES=ON --- .github/workflows/clang_linux.yml | 4 +++ .github/workflows/fedora_rawhide.yml | 37 +++++++++++++++++++++++ .github/workflows/fedora_rawhide/start.sh | 31 +++++++++++++++++++ .github/workflows/windows.yml | 2 +- 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/fedora_rawhide.yml create mode 100755 .github/workflows/fedora_rawhide/start.sh diff --git a/.github/workflows/clang_linux.yml b/.github/workflows/clang_linux.yml index 0794d4bb8b..b0cfe2cdb4 100644 --- a/.github/workflows/clang_linux.yml +++ b/.github/workflows/clang_linux.yml @@ -31,6 +31,10 @@ jobs: id: regular PROJ_CMAKE_BUILD_OPTIONS: "" + - name: EMBED_RESOURCE_FILES + id: EMBED_RESOURCE_FILES + PROJ_CMAKE_BUILD_OPTIONS: "-DEMBED_RESOURCE_FILES=ON" + - name: Without TIFF id: without_tiff PROJ_CMAKE_BUILD_OPTIONS: "-DENABLE_TIFF=OFF" diff --git a/.github/workflows/fedora_rawhide.yml b/.github/workflows/fedora_rawhide.yml new file mode 100644 index 0000000000..99b6caf3f3 --- /dev/null +++ b/.github/workflows/fedora_rawhide.yml @@ -0,0 +1,37 @@ +name: Fedora Rawhide + +on: + push: + paths-ignore: + - 'docs/**' + pull_request: + paths-ignore: + - 'docs/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + + fedora_rawhide: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache + uses: actions/cache@v4 + id: cache + with: + path: | + ${{ github.workspace }}/ccache.tar.gz + key: ${{ runner.os }}-cache-fedora_rawhide-${{ github.run_id }} + restore-keys: ${{ runner.os }}-cache-fedora_rawhide- + + - name: Run + run: docker run -e CI -e WORK_DIR="$PWD" -v $PWD:$PWD fedora:rawhide $PWD/.github/workflows/fedora_rawhide/start.sh diff --git a/.github/workflows/fedora_rawhide/start.sh b/.github/workflows/fedora_rawhide/start.sh new file mode 100755 index 0000000000..1fff57ed78 --- /dev/null +++ b/.github/workflows/fedora_rawhide/start.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -e + +dnf install -y cmake clang ccache ninja-build sqlite-devel libtiff-devel libcurl-devel diffutils + +cd "$WORK_DIR" + +if test -f "$WORK_DIR/ccache.tar.gz"; then + echo "Restoring ccache..." + (cd $HOME && tar xzf "$WORK_DIR/ccache.tar.gz") +fi + +export CCACHE_CPP2=yes + +ccache -M 500M +ccache -s + +mkdir build +cd build +CC=clang CXX=clang++ cmake .. \ + -DEMBED_RESOURCE_FILES=ON -DUSE_ONLY_EMBEDDED_RESOURCE_FILES=ON -DUSE_CCACHE=ON -DPROJ_DB_CACHE_DIR=$HOME/.ccache .. +make -j$(nproc) +ctest -j$(nproc) +cd .. + +ccache -s + +echo "Saving ccache..." +rm -f "$WORK_DIR/ccache.tar.gz" +(cd $HOME && tar czf "$WORK_DIR/ccache.tar.gz" .ccache) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 59be3bdd84..eaf041dd9d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -72,7 +72,7 @@ jobs: set PROJ_DIR=%GITHUB_WORKSPACE%\proj_dir :: Not directly linked to BUILD_SHARED_LIBS, but a way to test different C++ standard versions if "${{ env.BUILD_SHARED_LIBS }}"=="ON" (set EXTRA_CXX_FLAGS="/std:c++20") - if "${{ env.BUILD_TYPE }}"=="Release" (set CMAKE_UNITY_BUILD_OPT="-DCMAKE_UNITY_BUILD=ON") + if "${{ env.BUILD_TYPE }}"=="Release" (set CMAKE_UNITY_BUILD_OPT="-DCMAKE_UNITY_BUILD=ON -DEMBED_RESOURCE_FILES=ON") cmake -D CMAKE_BUILD_TYPE="${{ env.BUILD_TYPE }}" ^ -D BUILD_SHARED_LIBS="${{ env.BUILD_SHARED_LIBS }}" ^ -D CMAKE_C_FLAGS="/WX" ^