Skip to content

Commit

Permalink
[ci]: add testing pipelines to github actions (#1159)
Browse files Browse the repository at this point in the history
move pipeline testing from AzDO to GitHub Actions.

* update clang versions to 13-15
* update gcc versions to 10-12
* update xcode versions to 14.3.1 and 15.4
* test against C++23 (where supported)
  • Loading branch information
carsonRadtke authored Oct 14, 2024
1 parent 11fe02d commit ce2a959
Show file tree
Hide file tree
Showing 9 changed files with 168 additions and 160 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/cmake/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Composite CMake
inputs:
cmake_generator:
required: false
type: string
default: 'Unix Makefiles'
cmake_build_type:
required: true
type: string
default: ''
cmake_cxx_compiler:
required: false
type: string
gsl_cxx_standard:
required: true
type: number
extra_cmake_args:
required: false
type: string
default: ''
build_cmd:
required: true
type: string
default: 'make'
test_cmd:
required: false
type: string
default: 'make test'
shell:
required: false
type: string
default: 'bash'


runs:
using: composite
steps:
- name: Create build directory
run: mkdir build
shell: ${{ inputs.shell }}

- name: Configure CMake
working-directory: build
run: cmake -G "${{ inputs.cmake_generator }}" -DCMAKE_BUILD_TYPE=${{ inputs.cmake_build_type }} -DCMAKE_CXX_COMPILER=${{ inputs.cmake_cxx_compiler }} -DGSL_CXX_STANDARD=${{ inputs.gsl_cxx_standard }} -DCI_TESTING:BOOL=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -Werror=dev ${{ inputs.extra_cmake_args }} ..
shell: ${{ inputs.shell }}

- name: Build
working-directory: build
run: ${{ inputs.build_cmd }}
shell: ${{ inputs.shell }}

- name: Test
working-directory: build
run: ${{ inputs.test_cmd }}
shell: ${{ inputs.shell }}

104 changes: 104 additions & 0 deletions .github/workflows/compilers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Compiler Integration Tests

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# These jobs are correlated with the officially supported compilers
# and toolsets. If you change any versions, please update README.md.

jobs:
gcc:
strategy:
matrix:
gcc_version: [ 10, 11, 12 ]
build_type: [ Debug, Release ]
cxx_version: [ 14, 17, 20, 23 ]
exclude:
- gcc_version: 10
cxx_version: 23
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Run CMake (configure, build, test)
uses: ./.github/workflows/cmake
with:
cmake_build_type: ${{ matrix.build_type }}
cmake_cxx_compiler: g++-${{ matrix.gcc_version }}
gsl_cxx_standard: ${{ matrix.cxx_version }}

clang:
strategy:
matrix:
clang_version: [ 13, 14, 15 ]
build_type: [ Debug, Release ]
cxx_version: [ 14, 17, 20, 23 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Run CMake (configure, build, test)
uses: ./.github/workflows/cmake
with:
cmake_build_type: ${{ matrix.build_type }}
cmake_cxx_compiler: clang++-${{ matrix.clang_version }}
gsl_cxx_standard: ${{ matrix.cxx_version }}

xcode:
strategy:
matrix:
xcode_version: [ '14.3.1', '15.4' ]
build_type: [ Debug, Release ]
cxx_version: [ 14, 17, 20, 23 ]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: select xcode version
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode_version }}.app

- name: Run CMake (configure, build, test)
uses: ./.github/workflows/cmake
with:
cmake_build_type: ${{ matrix.build_type }}
cmake_cxx_compiler: clang++
gsl_cxx_standard: ${{ matrix.cxx_version }}

VisualStudio:
strategy:
matrix:
generator: [ 'Visual Studio 16 2019', 'Visual Studio 17 2022' ]
image: [ windows-2019, windows-2022 ]
build_type: [ Debug, Release ]
extra_args: [ '', '-T ClangCL' ]
cxx_version: [ 14, 17, 20, 23 ]
exclude:
- generator: 'Visual Studio 17 2022'
image: windows-2019
- generator: 'Visual Studio 16 2019'
image: windows-2022
- generator: 'Visual Studio 16 2019'
cxx_version: 23
runs-on: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v2

- name: Run CMake (configure, build, test)
uses: ./.github/workflows/cmake
with:
cmake_generator: ${{ matrix.generator }}
cmake_build_type: ${{ matrix.build_type }}
gsl_cxx_standard: ${{ matrix.cxx_version }}
extra_cmake_args: ${{ matrix.extra_args }}
build_cmd: msbuild GSL.sln
test_cmd: ctest . --output-on-failure --no-compress-output
shell: pwsh

23 changes: 8 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,24 +86,17 @@ This is based on [CppCoreGuidelines semi-specification](https://github.com/isocp

# Quick Start
## Supported Compilers / Toolsets
The GSL officially supports the latest and previous major versions of VS with MSVC & LLVM, GCC, Clang, and XCode with Apple-Clang.
Within these two major versions, we try to target the latest minor updates / revisions (although this may be affected by
delays between a toolchain's release and when it becomes widely available for use).
Below is a table showing the versions currently being tested.
The GSL officially supports recent major versions of Visual Studio with both MSVC and LLVM, GCC, Clang, and XCode with Apple-Clang.
For each of these major versions, the GSL officially supports C++14, C++17, C++20, and C++23 (when supported by the compiler).
Below is a table showing the versions currently being tested (also see [.github/workflows/compilers.yml](the workflow).)

Compiler |Toolset Versions Currently Tested
:------- |--:
XCode | 13.2.1 & 12.5.1
GCC | 11[^1] & 10[^2]
Clang | 12[^2] & 11[^2]
Visual Studio with MSVC | VS2022[^3] & VS2019[^4]
Visual Studio with LLVM | VS2022[^3] & VS2019[^4]


[^1]: Precise version may be found in the [latest CI results](https://dev.azure.com/cppstat/GSL/_build?definitionId=1&branchFilter=26).
[^2]: Precise version may be found in the [latest CI results](https://dev.azure.com/cppstat/GSL/_build?definitionId=1&branchFilter=26). Should be the version specified [here](https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#language-and-runtime).
[^3]: Precise version may be found in the [latest CI results](https://dev.azure.com/cppstat/GSL/_build?definitionId=1&branchFilter=26). Should be the version specified [here](https://github.com/actions/virtual-environments/blob/main/images/win/Windows2022-Readme.md#visual-studio-enterprise-2022).
[^4]: Precise version may be found in the [latest CI results](https://dev.azure.com/cppstat/GSL/_build?definitionId=1&branchFilter=26). Should be the version specified [here](https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#visual-studio-enterprise-2019).
GCC | 10, 11, 12
XCode | 14.3.1, 15.4
Clang | 13, 14, 15
Visual Studio with MSVC | VS2019, VS2022
Visual Studio with LLVM | VS2019, VS2022

---
If you successfully port GSL to another platform, we would love to hear from you!
Expand Down
66 changes: 0 additions & 66 deletions azure-pipelines.yml

This file was deleted.

43 changes: 0 additions & 43 deletions pipelines/jobs.yml

This file was deleted.

9 changes: 0 additions & 9 deletions pipelines/setup_apple.yml

This file was deleted.

13 changes: 0 additions & 13 deletions pipelines/setup_clang.yml

This file was deleted.

14 changes: 0 additions & 14 deletions pipelines/setup_gcc.yml

This file was deleted.

Empty file removed pipelines/steps.yml
Empty file.

0 comments on commit ce2a959

Please sign in to comment.