Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler test #84

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 73 additions & 1 deletion .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,81 @@ jobs:
cmake --install build --config Debug --prefix /opt/beman.exemplar
find /opt/beman.exemplar -type f

compiler-test:
runs-on: ubuntu-24.04
strategy:
matrix:
compilers:
- class: GNU
version: 14
- class: GNU
version: 13
- class: GNU
version: 12
- class: LLVM
version: 20
- class: LLVM
version: 19
- class: LLVM
version: 18
- class: LLVM
version: 17
name: "Compiler: ${{ matrix.compilers.class }} ${{ matrix.compilers.version }}"
steps:
- uses: actions/checkout@v4
- name: Setup build environment
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.25.0"
ninjaVersion: "^1.11.1"
- name: Install Compiler
id: install-compiler
run: |
if [ "${{ matrix.compilers.class }}" = "GNU" ]; then
CC=gcc-${{ matrix.compilers.version }}
CXX=g++-${{ matrix.compilers.version }}

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install -y $CC
sudo apt-get install -y $CXX

$CC --version
$CXX --version
else
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo bash llvm.sh ${{ matrix.compilers.version }}

CC=clang-${{ matrix.compilers.version }}
CXX=clang++-${{ matrix.compilers.version }}

$CC --version
$CXX --version
fi

echo "CC=$CC" >> "$GITHUB_OUTPUT"
echo "CXX=$CXX" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: |
cmake -B build -S . -DCMAKE_CXX_STANDARD=20
env:
CC: ${{ steps.install-compiler.outputs.CC }}
CXX: ${{ steps.install-compiler.outputs.CXX }}
CMAKE_GENERATOR: "Ninja Multi-Config"
- name: Build Debug
run: |
cmake --build build --config Debug --verbose
cmake --build build --config Debug --target all_verify_interface_header_sets
cmake --install build --config Debug --prefix /opt/beman.exemplar
find /opt/beman.exemplar -type f
- name: Test Debug
run: ctest --test-dir build --build-config Debug


create-issue-when-fault:
runs-on: ubuntu-latest
needs: [preset-test, gtest-test, configuration-test]
needs: [preset-test, gtest-test, configuration-test, compiler-test]
if: failure() && github.event_name == 'schedule'
steps:
# See https://github.com/cli/cli/issues/5075
Expand Down