-
Notifications
You must be signed in to change notification settings - Fork 8
146 lines (122 loc) · 4.18 KB
/
ci-linux.yml
File metadata and controls
146 lines (122 loc) · 4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
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 }}