mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-25 01:01:58 -05:00
convert clang and gcc to github action
This commit is contained in:
parent
a0550c7d81
commit
a79e43a6dd
75
.github/workflows/compilers.yml
vendored
75
.github/workflows/compilers.yml
vendored
@ -11,14 +11,74 @@ on:
|
|||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
# TODO (@carsonradtke)
|
||||||
|
# - [ ] Xcode
|
||||||
|
# - [ ] VS_LLVM
|
||||||
|
|
||||||
|
gcc:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
cxx_version: [ 14, 17, 20 ]
|
||||||
|
build_type: [ 'Debug', 'Release' ]
|
||||||
|
gcc_version: [ 12, 13, 14 ]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: create build directory
|
||||||
|
run: mkdir build
|
||||||
|
|
||||||
|
- name: cmake configure
|
||||||
|
working-directory: build
|
||||||
|
run: |
|
||||||
|
CC=gcc-${{ matrix.gcc_version }}
|
||||||
|
CXX=g++-${{ matrix.gcc_version }}
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DGSL_CXX_STANDARD=${{ matrix.cxx_version }} -DCI_TESTING:BOOL=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -Werror=dev -DCMAKE_CXX_COMPILER=g++-${{ matrix.gcc_version }} ..
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
working-directory: build
|
||||||
|
run: make
|
||||||
|
|
||||||
|
- name: test
|
||||||
|
working-directory: build
|
||||||
|
run: make test
|
||||||
|
|
||||||
|
clang:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
cxx_version: [ 14, 17, 20 ]
|
||||||
|
build_type: [ 'Debug', 'Release' ]
|
||||||
|
clang_version: [ 16, 17, 18 ]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: create build directory
|
||||||
|
run: mkdir build
|
||||||
|
|
||||||
|
- name: cmake configure
|
||||||
|
working-directory: build
|
||||||
|
run: |
|
||||||
|
CC=clang-${{ matrix.clang_version }}
|
||||||
|
CXX=clang++-${{ matrix.clang_version }}
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DGSL_CXX_STANDARD=${{ matrix.cxx_version }} -DCI_TESTING:BOOL=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -Werror=dev -DCMAKE_CXX_COMPILER=g++-${{ matrix.gcc_version }} ..
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
working-directory: build
|
||||||
|
run: make
|
||||||
|
|
||||||
|
- name: test
|
||||||
|
working-directory: build
|
||||||
|
run: make test
|
||||||
|
|
||||||
VS_MSVC:
|
VS_MSVC:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
image: [ windows-2022 ]
|
generator: [ "Visual Studio 16 2019", "Visual Studio 17 2022" ]
|
||||||
generator: [ "Visual Studio 17 2022" ]
|
cxx_version: [ 14, 17, 20 ]
|
||||||
cxx_version: [ 20 ]
|
|
||||||
build_type: [ 'Debug', 'Release' ]
|
build_type: [ 'Debug', 'Release' ]
|
||||||
runs-on: ${{ matrix.image }}
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: microsoft/setup-msbuild@v1
|
- uses: microsoft/setup-msbuild@v1
|
||||||
@ -38,10 +98,3 @@ jobs:
|
|||||||
working-directory: build
|
working-directory: build
|
||||||
run: ctest . --output-on-failure --no-compress-output
|
run: ctest . --output-on-failure --no-compress-output
|
||||||
|
|
||||||
# TODO (@carsonradtke)
|
|
||||||
# - [ ] GCC
|
|
||||||
# - [ ] Clang
|
|
||||||
# - [ ] Xcode
|
|
||||||
# - [ ] VS_LLVM
|
|
||||||
# - [ ] delete azure-pipelines.yml
|
|
||||||
# - [ ] delete pipelines/
|
|
||||||
|
@ -1,66 +0,0 @@
|
|||||||
trigger:
|
|
||||||
- main
|
|
||||||
|
|
||||||
pr:
|
|
||||||
autoCancel: true
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- stage: GCC
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: ./pipelines/jobs.yml
|
|
||||||
parameters:
|
|
||||||
compiler: gcc
|
|
||||||
image: ubuntu-20.04
|
|
||||||
compilerVersions: [ 11, 10 ]
|
|
||||||
setupfile: 'setup_gcc.yml'
|
|
||||||
|
|
||||||
- stage: Clang
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: ./pipelines/jobs.yml
|
|
||||||
parameters:
|
|
||||||
compiler: clang
|
|
||||||
image: ubuntu-20.04
|
|
||||||
compilerVersions: [ 12, 11 ]
|
|
||||||
setupfile: 'setup_clang.yml'
|
|
||||||
|
|
||||||
- stage: Xcode
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: ./pipelines/jobs.yml
|
|
||||||
parameters:
|
|
||||||
compiler: 'Xcode'
|
|
||||||
image: macOS-11
|
|
||||||
compilerVersions: [ '12.5.1', '13.2.1' ]
|
|
||||||
setupfile: 'setup_apple.yml'
|
|
||||||
|
|
||||||
- stage: VS_MSVC
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: ./pipelines/jobs.yml
|
|
||||||
parameters:
|
|
||||||
compiler: 'VS2019 (MSVC)'
|
|
||||||
compilerVersions: [ 'default' ]
|
|
||||||
image: windows-2019
|
|
||||||
- template: ./pipelines/jobs.yml
|
|
||||||
parameters:
|
|
||||||
compiler: 'VS2022 (MSVC)'
|
|
||||||
compilerVersions: [ 'default' ]
|
|
||||||
image: windows-2022
|
|
||||||
|
|
||||||
- stage: VS_LLVM
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: ./pipelines/jobs.yml
|
|
||||||
parameters:
|
|
||||||
compiler: 'VS2019 (LLVM)'
|
|
||||||
compilerVersions: [ 'default' ]
|
|
||||||
image: windows-2019
|
|
||||||
extraCmakeArgs: '-T ClangCL'
|
|
||||||
- template: ./pipelines/jobs.yml
|
|
||||||
parameters:
|
|
||||||
compiler: 'VS2022 (LLVM)'
|
|
||||||
compilerVersions: [ 'default' ]
|
|
||||||
image: windows-2022
|
|
||||||
extraCmakeArgs: '-T ClangCL'
|
|
@ -1,43 +0,0 @@
|
|||||||
parameters:
|
|
||||||
CXXVersions: [ 14, 17, 20 ]
|
|
||||||
buildTypes: [ 'Debug', 'Release' ]
|
|
||||||
image: ''
|
|
||||||
|
|
||||||
compiler: ''
|
|
||||||
compilerVersions: ["default"] # if default value, simply uses whatever version is on the machine.
|
|
||||||
# the text of this default value doesn't actually matter.
|
|
||||||
setupfile: ''
|
|
||||||
extraCmakeArgs: ''
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
- ${{ each compilerVersion in parameters.compilerVersions }}:
|
|
||||||
- ${{ each CXXVersion in parameters.CXXVersions }}:
|
|
||||||
- ${{ each buildType in parameters.buildTypes }}:
|
|
||||||
- job:
|
|
||||||
displayName: ${{ format('{0} {1} C++{2} {3}', parameters.compiler, compilerVersion, CXXVersion, buildType) }}
|
|
||||||
pool:
|
|
||||||
vmImage: ${{ parameters.image }}
|
|
||||||
continueOnError: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- ${{ if not(eq(parameters.setupfile, '')) }}:
|
|
||||||
- template: ${{ parameters.setupfile }}
|
|
||||||
parameters:
|
|
||||||
version: ${{ compilerVersion }}
|
|
||||||
|
|
||||||
- task: CMake@1
|
|
||||||
name: Configure
|
|
||||||
inputs:
|
|
||||||
workingDirectory: build
|
|
||||||
cmakeArgs: '-DGSL_CXX_STANDARD=${{ CXXVersion }} -DCMAKE_BUILD_TYPE=${{ buildType }} -DCI_TESTING:BOOL=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -Werror=dev ${{ parameters.extraCmakeArgs }} .. '
|
|
||||||
|
|
||||||
- task: CMake@1
|
|
||||||
name: Build
|
|
||||||
inputs:
|
|
||||||
workingDirectory: build
|
|
||||||
cmakeArgs: '--build . '
|
|
||||||
|
|
||||||
- script: ctest . --output-on-failure --no-compress-output
|
|
||||||
name: CTest
|
|
||||||
workingDirectory: build
|
|
||||||
failOnStderr: true
|
|
@ -1,9 +0,0 @@
|
|||||||
parameters:
|
|
||||||
version: 0
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- script: |
|
|
||||||
if [ "${{ parameters.version }}" != "default" ]; then sudo xcode-select -switch /Applications/Xcode_${{ parameters.version }}.app; fi
|
|
||||||
|
|
||||||
displayName: "Setup Xcode Version"
|
|
||||||
failOnStderr: true
|
|
@ -1,13 +0,0 @@
|
|||||||
parameters:
|
|
||||||
version: 0
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- script: |
|
|
||||||
echo "##vso[task.setvariable variable=CXX;]${CXX}"
|
|
||||||
echo "##vso[task.setvariable variable=CC;]${CC}"
|
|
||||||
|
|
||||||
displayName: "Setup Clang Version"
|
|
||||||
failOnStderr: true
|
|
||||||
env:
|
|
||||||
CC: clang-${{ parameters.version }}
|
|
||||||
CXX: clang++-${{ parameters.version }}
|
|
@ -1,14 +0,0 @@
|
|||||||
parameters:
|
|
||||||
version: 0
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- script: |
|
|
||||||
echo "##vso[task.setvariable variable=CXX;]${CXX}"
|
|
||||||
echo "##vso[task.setvariable variable=CC;]${CC}"
|
|
||||||
if [ "${{ parameters.version }}" = "11" ]; then sudo apt-get install $CXX; fi
|
|
||||||
|
|
||||||
displayName: "Setup GCC Version"
|
|
||||||
failOnStderr: true
|
|
||||||
env:
|
|
||||||
CC: gcc-${{ parameters.version }}
|
|
||||||
CXX: g++-${{ parameters.version }}
|
|
Loading…
Reference in New Issue
Block a user