Skip to content

Linux

Linux #255

Workflow file for this run

name: Linux
on:
workflow_call:
push:
branches: [ main ]
schedule:
- cron: "4 5 * * 0"
jobs:
build:
if: ${{!contains(github.event.head_commit.message, 'skip-ci')}}
strategy:
matrix:
build_type: [ Debug, Release ]
compiler:
- cc: clang-13
cxx: clang++-13
- cc: clang-14
cxx: clang++-14
- cc: clang-15
cxx: clang++-15
- cc: gcc-10
cxx: g++-10
- cc: gcc-11
cxx: g++-11
- cc: gcc-12
cxx: g++-12
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-22.04
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
# test for issue: https://github.com/qqiangwu/cppship/issues/75
CMAKE_GENERATOR: "Ninja Multi-Config"
steps:
- uses: actions/checkout@v3
# Hack to deal with https://github.com/actions/runner-images/issues/8659
- name: Fix GCC
run: |
sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list
sudo apt-get update
sudo apt-get install -y --allow-downgrades libstdc++6=12.3.0-1ubuntu1~22.04 libgcc-s1=12.3.0-1ubuntu1~22.04
- name: Install conan
run: pip3 install conan
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build_type }}
- name: Install
run: cmake --install ${{github.workspace}}/build --config ${{ matrix.build_type }}
- name: Configure CMake With Tests
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TEST=ON
- name: Build Tests
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build_type }}
- name: Test
run: ctest --output-on-failure --verbose
working-directory: build
- name: Run cppship
run: |
rm -rf build
type cppship
cppship
cppship build --profile ${{ matrix.build_type }}
cppship run --profile ${{ matrix.build_type }}
cppship test --profile ${{ matrix.build_type }}
- name: Cppship init app
run: |
mkdir .bin && cd .bin
cppship init . --name app
test -f .clang-tidy
test -f .clang-format
test -f .gitignore
cppship build
cppship run
cppship test
cppship install
type app
cd ..
- name: Cppship init lib
run: |
mkdir .lib && cd .lib
cppship init . --name lib --lib
test -f .clang-tidy
test -f .clang-format
cppship build
cppship test
- name: Test cppship
run: |
unset CMAKE_GENERATOR
git clone https://github.com/qqiangwu/cppship-examples.git
cd cppship-examples
bash verify.sh
build-gcc13:
if: ${{!contains(github.event.head_commit.message, 'skip-ci')}}
strategy:
matrix:
build_type: [ Debug, Release ]
runs-on: ubuntu-22.04
container: gcc:13
steps:
- uses: actions/checkout@v3
- name: Install Deps
run: |
apt update -y
apt install -y cmake python3 python3-pip
shell: bash
- name: Install conan
run: pip3 install conan --break-system-packages
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build_type }}
- name: Install
run: cmake --install ${{github.workspace}}/build --config ${{ matrix.build_type }}
- name: Run cppship
run: |
rm -rf build
type cppship
cppship
cppship build --profile ${{ matrix.build_type }}
cppship run --profile ${{ matrix.build_type }}