Skip to content

Commit

Permalink
GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
LiangliangNan committed Dec 2, 2024
1 parent 1add06a commit dfd3873
Showing 1 changed file with 15 additions and 37 deletions.
52 changes: 15 additions & 37 deletions .github/workflows/test-build-gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,21 @@ on: [push, pull_request]

jobs:
build:
name: Build with ${{ matrix.compiler }}
name: ${{ matrix.compilers }}
strategy:
fail-fast: false
matrix:
compiler:
- name: g++-7
version: 7
- name: g++-8
version: 8
- name: g++-9
version: 9
- name: g++-10
version: 10
- name: g++-11
version: 11

fail-fast: false
matrix:
compilers: [g++-7, g++-8, g++-9, g++-10]
runs-on: ubuntu-20.04

steps:
- name: Check out the repository
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake \
libglu1-mesa-dev freeglut3-dev mesa-common-dev \
libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev
- name: Install GCC version ${{ matrix.compiler.name }}
run: |
sudo apt-get install -y gcc-${{ matrix.compiler.version }} g++-${{ matrix.compiler.version }}
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.compiler.version }} 100
g++ --version
- name: Configure and build with CMake
run: |
mkdir -p build && cd build
cmake -DCMAKE_CXX_COMPILER=$(which g++) -DCMAKE_BUILD_TYPE=Release ..
make
- uses: actions/checkout@v1
- run: sudo apt-get update || true;
sudo apt-get install ${{ matrix.compilers }};
sudo apt-get install build-essential libglu1-mesa-dev freeglut3-dev mesa-common-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev;
cd src;
rm -rf Release;
mkdir Release;
cd Release;
cmake -DCMAKE_CXX_COMPILER=${{ matrix.compilers }} -DCMAKE_BUILD_TYPE=Release ..;
make;

0 comments on commit dfd3873

Please sign in to comment.