From 83c207c0d7036f84f3233a7aa808585d3105c40c Mon Sep 17 00:00:00 2001 From: Gyusun Yeom Date: Fri, 11 Apr 2025 23:34:33 +0900 Subject: [PATCH] Fix GHA build test --- .github/workflows/cmake.yml | 101 +++++++++++------------------------- 1 file changed, 31 insertions(+), 70 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 5719ce4..a6cc586 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -18,10 +18,6 @@ env: jobs: build: - # The CMake configure and build commands are platform agnostic and should work equally - # well on Windows or Mac. You can convert this to a matrix build if you need - # cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix runs-on: ubuntu-latest container: ubuntu:latest @@ -91,91 +87,56 @@ jobs: cmake . cmake --build . - build_2_8: - # The CMake configure and build commands are platform agnostic and should work equally - # well on Windows or Mac. You can convert this to a matrix build if you need - # cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: ubuntu-latest - container: ubuntu:14.04 - - steps: - - uses: actions/checkout@v2 - - - name: Install dependencies - run: apt update && apt install -y cmake gcc libgl1-mesa-dev libx11-dev libxext-dev - - - name: Configure CMake - shell: bash - run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE - - - name: Build test - shell: bash - run: cmake --build . - - - name: Check alias - shell: bash - run: test -e lib/libGLEW.a - - build_3_10: - # The CMake configure and build commands are platform agnostic and should work equally - # well on Windows or Mac. You can convert this to a matrix build if you need - # cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: ubuntu-latest - container: ubuntu:18.04 - - steps: - - uses: actions/checkout@v2 - - - name: Install dependencies - run: apt update && apt install -y cmake gcc libgl1-mesa-dev libx11-dev libxext-dev - - - name: Configure CMake - shell: bash - run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE - - - name: Build test - shell: bash - run: cmake --build . - - - name: Check alias - shell: bash - run: test -e lib/libGLEW.a - - build_latest: + build_linux: + strategy: + fail-fast: false + matrix: + cmake: + - 2.8.12.2 + - 3.10.3 + - latest runs-on: ubuntu-latest container: ubuntu:latest steps: - uses: actions/checkout@v2 - + - name: Install dependencies - run: apt update && apt install -y python3 python3-pip gcc libgl1-mesa-dev libx11-dev libxext-dev && pip install cmake - + shell: bash + run: | + cmake=${{ matrix.cmake }} + apt update + apt install -y wget gcc libgl1-mesa-dev libx11-dev libxext-dev + if [ "${cmake}" == "latest" ]; then + apt install -y git + cmake=$(git ls-remote --tags https://gitlab.kitware.com/cmake/cmake | cut -f 2 | sed -E "s/^refs\/tags\/v//" | tr -d "^{}" | sort -t '.' -k 1,1n -k 2,2n -k 3,3n | tail -n 1 | tr -d "\n") + echo "Latest version: ${cmake}" + fi + short_version=$(echo "${cmake}" | sed -E "s/^([0-9]+\\.[0-9]+)\\..+$/\\1/" | tr -d "\n") + wget https://cmake.org/files/v${short_version}/cmake-${cmake}.tar.gz + tar -xf cmake-${cmake}.tar.gz + cd cmake-${cmake} + ./configure && make -j $(nproc) install + - name: Configure CMake shell: bash run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE - + - name: Build test shell: bash run: cmake --build . - + - name: Check alias shell: bash run: test -e lib/libGLEW.a build_mingw: - # The CMake configure and build commands are platform agnostic and should work equally - # well on Windows or Mac. You can convert this to a matrix build if you need - # cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix runs-on: ubuntu-latest - container: ubuntu:18.04 + container: ubuntu:latest steps: - uses: actions/checkout@v2 - + - name: Install dependencies run: apt update && apt install -y cmake g++-mingw-w64-x86-64 make libgl1-mesa-dev libx11-dev libxext-dev @@ -193,7 +154,7 @@ jobs: steps: - uses: actions/checkout@v2 - + - name: Configure CMake shell: bash run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE @@ -207,7 +168,7 @@ jobs: steps: - uses: actions/checkout@v2 - + - name: Configure CMake shell: bash run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE