From a79e43a6dd970feb1f0882712f1fad45aac3351f Mon Sep 17 00:00:00 2001 From: Carson Radtke Date: Mon, 14 Oct 2024 09:54:12 -0500 Subject: [PATCH] convert clang and gcc to github action --- .github/workflows/compilers.yml | 75 ++++++++++++++++++++++++++++----- azure-pipelines.yml | 66 ----------------------------- pipelines/jobs.yml | 43 ------------------- pipelines/setup_apple.yml | 9 ---- pipelines/setup_clang.yml | 13 ------ pipelines/setup_gcc.yml | 14 ------ pipelines/steps.yml | 0 7 files changed, 64 insertions(+), 156 deletions(-) delete mode 100644 azure-pipelines.yml delete mode 100644 pipelines/jobs.yml delete mode 100644 pipelines/setup_apple.yml delete mode 100644 pipelines/setup_clang.yml delete mode 100644 pipelines/setup_gcc.yml delete mode 100644 pipelines/steps.yml diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml index 4646dfa..0051b49 100644 --- a/.github/workflows/compilers.yml +++ b/.github/workflows/compilers.yml @@ -11,14 +11,74 @@ on: branches: [ main ] 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: strategy: matrix: - image: [ windows-2022 ] - generator: [ "Visual Studio 17 2022" ] - cxx_version: [ 20 ] + generator: [ "Visual Studio 16 2019", "Visual Studio 17 2022" ] + cxx_version: [ 14, 17, 20 ] build_type: [ 'Debug', 'Release' ] - runs-on: ${{ matrix.image }} + runs-on: windows-latest steps: - uses: actions/checkout@v4 - uses: microsoft/setup-msbuild@v1 @@ -38,10 +98,3 @@ jobs: working-directory: build run: ctest . --output-on-failure --no-compress-output - # TODO (@carsonradtke) - # - [ ] GCC - # - [ ] Clang - # - [ ] Xcode - # - [ ] VS_LLVM - # - [ ] delete azure-pipelines.yml - # - [ ] delete pipelines/ diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index ba16ee9..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -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' diff --git a/pipelines/jobs.yml b/pipelines/jobs.yml deleted file mode 100644 index aabd3db..0000000 --- a/pipelines/jobs.yml +++ /dev/null @@ -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 diff --git a/pipelines/setup_apple.yml b/pipelines/setup_apple.yml deleted file mode 100644 index 6a256a5..0000000 --- a/pipelines/setup_apple.yml +++ /dev/null @@ -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 diff --git a/pipelines/setup_clang.yml b/pipelines/setup_clang.yml deleted file mode 100644 index 58403b4..0000000 --- a/pipelines/setup_clang.yml +++ /dev/null @@ -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 }} diff --git a/pipelines/setup_gcc.yml b/pipelines/setup_gcc.yml deleted file mode 100644 index 6480f67..0000000 --- a/pipelines/setup_gcc.yml +++ /dev/null @@ -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 }} diff --git a/pipelines/steps.yml b/pipelines/steps.yml deleted file mode 100644 index e69de29..0000000