From 6e1b49cc5bbb1387c9b430cfe76c37c8f49ae2f6 Mon Sep 17 00:00:00 2001 From: levalup Date: Mon, 1 Jul 2024 21:51:50 +0800 Subject: [PATCH] download cmake in container gcc:4.8.5 classic --- .github/workflows/build-classic.yml | 36 ++++++++++++++++++----------- .github/workflows/build-gcc.yml | 10 ++++---- .github/workflows/build.yml | 6 ++--- .github/workflows/single-header.yml | 4 ++-- 4 files changed, 34 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-classic.yml b/.github/workflows/build-classic.yml index c263d1f..b92ccda 100644 --- a/.github/workflows/build-classic.yml +++ b/.github/workflows/build-classic.yml @@ -1,4 +1,4 @@ -name: Build Classic GCC 4.8.5 +name: Build Classic on: push: @@ -17,33 +17,43 @@ jobs: ! contains(toJSON(github.event.commits.*.message), '[skip ci]') && ! contains(toJSON(github.event.commits.*.message), '[skip github]') - runs-on: ${{matrix.os}} + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - os: [ 'centos-7' ] gcc_version: [ '4.8.5' ] + cmake_version: [ '3.29.6' ] build_type: [ Release ] - name: "On ${{matrix.os}} gcc-${{matrix.gcc_version}} ${{matrix.build_type}}" + name: "In Container GCC ${{matrix.gcc_version}} ${{matrix.build_type}}" + + container: + image: gcc:${{matrix.gcc_version}} steps: - uses: actions/checkout@v1 with: submodules: recursive - - uses: friendlyanon/fetch-core-count@v1 - id: cores - - name: Set output id: strings shell: bash run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - name: CMake & GCC + - name: Download CMake + run: >- + wget --no-check-certificate + https://github.com/Kitware/CMake/releases/download/v${{matrix.cmake_version}}/cmake-${{matrix.cmake_version}}-linux-x86_64.tar.gz + + - name: Install CMake + run: | + tar -xvf cmake-${{matrix.cmake_version}}-linux-x86_64.tar.gz + echo "`pwd`/cmake-${{matrix.cmake_version}}-Linux-x86_64/bin" >> $GITHUB_PATH + + - name: CMake & GCC Information run: | cmake --version gcc --version @@ -51,15 +61,15 @@ jobs: - name: Configure run: >- - cmake -B "${{ steps.strings.outputs.build-output-dir }}" + cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -S "${{ github.workspace }}" + -S . - name: Build run: >- - cmake --build "${{ steps.strings.outputs.build-output-dir }}" + cmake --build build --config ${{ matrix.build_type }} - name: Test - working-directory: "${{ steps.strings.outputs.build-output-dir }}" - run: ctest --output-on-failure --build-config ${{ matrix.build_type }} + working-directory: build + run: ctest --output-on-failure --build-config ${{ matrix.build_type }} diff --git a/.github/workflows/build-gcc.yml b/.github/workflows/build-gcc.yml index a252297..9d1e07e 100644 --- a/.github/workflows/build-gcc.yml +++ b/.github/workflows/build-gcc.yml @@ -23,8 +23,8 @@ jobs: fail-fast: false matrix: - gcc_version: ['latest', '12', '11', '10', '9', '8', '7', '6', '5'] - build_type: [Release] + gcc_version: [ 'latest', '12', '11', '10', '9', '8', '7', '6', '5' ] + build_type: [ Release ] name: "In Container GCC ${{matrix.gcc_version}} ${{matrix.build_type}}" @@ -46,9 +46,11 @@ jobs: run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - name: CMake & GCC + - name: Mount CMake + run: echo "/host_usr_local/bin" >> $GITHUB_PATH + + - name: CMake & GCC Information run: | - echo "/host_usr_local/bin" >> $GITHUB_PATH cmake --version gcc --version g++ --version diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf199c5..0907e7b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,9 +32,9 @@ jobs: # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: - os: [ubuntu-latest, windows-latest] - build_type: [Release] - c_compiler: [gcc, clang, cl] + os: [ ubuntu-latest, windows-latest ] + build_type: [ Release ] + c_compiler: [ gcc, clang, cl ] include: - os: windows-latest c_compiler: cl diff --git a/.github/workflows/single-header.yml b/.github/workflows/single-header.yml index 15ac7fa..a10dd3d 100644 --- a/.github/workflows/single-header.yml +++ b/.github/workflows/single-header.yml @@ -23,8 +23,8 @@ jobs: fail-fast: false matrix: - os: [ubuntu-latest] - build_type: [Release] + os: [ ubuntu-latest ] + build_type: [ Release ] name: "Generate Single Header ${{matrix.build_type}}"