mirror of
https://github.com/Perlmint/glew-cmake.git
synced 2025-04-22 00:22:57 +00:00
Compare commits
2 Commits
0f28580a15
...
7c15704efa
Author | SHA1 | Date | |
---|---|---|---|
|
7c15704efa | ||
|
b87539999f |
31
.github/workflows/cmake.yml
vendored
31
.github/workflows/cmake.yml
vendored
@ -101,12 +101,28 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Restore cached cmake
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: /opt/cmake
|
||||||
|
key: cmake-${{ matrix.cmake }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cmake=${{ matrix.cmake }}
|
cmake=${{ matrix.cmake }}
|
||||||
apt update
|
apt update
|
||||||
apt install -y wget gcc libgl1-mesa-dev libx11-dev libxext-dev
|
apt install -y gcc make libgl1-mesa-dev libx11-dev libxext-dev
|
||||||
|
if [ -x /opt/cmake/bin/cmake ]; then
|
||||||
|
echo "Found cached cmake"
|
||||||
|
if [ -s "$(/opt/cmake/bin/cmake --version | grep ${cmake})" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "CMake version is mismatched"
|
||||||
|
rm -rf /opt/cmake
|
||||||
|
fi
|
||||||
|
|
||||||
|
apt install -y g++ wget
|
||||||
if [ "${cmake}" == "latest" ]; then
|
if [ "${cmake}" == "latest" ]; then
|
||||||
apt install -y git
|
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")
|
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")
|
||||||
@ -116,15 +132,22 @@ jobs:
|
|||||||
wget https://cmake.org/files/v${short_version}/cmake-${cmake}.tar.gz
|
wget https://cmake.org/files/v${short_version}/cmake-${cmake}.tar.gz
|
||||||
tar -xf cmake-${cmake}.tar.gz
|
tar -xf cmake-${cmake}.tar.gz
|
||||||
cd cmake-${cmake}
|
cd cmake-${cmake}
|
||||||
./configure && make -j $(nproc) install
|
./configure --prefix=/opt/cmake
|
||||||
|
make -j $(nproc) install
|
||||||
|
|
||||||
|
- name: Save cmake
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: /opt/cmake
|
||||||
|
key: cmake-${{ matrix.cmake }}
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
run: /opt/cmake/bin/cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
||||||
|
|
||||||
- name: Build test
|
- name: Build test
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cmake --build .
|
run: /opt/cmake/bin/cmake --build .
|
||||||
|
|
||||||
- name: Check alias
|
- name: Check alias
|
||||||
shell: bash
|
shell: bash
|
||||||
|
Loading…
Reference in New Issue
Block a user