-
Notifications
You must be signed in to change notification settings - Fork 7
138 lines (125 loc) · 4.12 KB
/
libelement.CLI.yml
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
name: libelement.CLI
on: [push]
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "ubuntu-gcc",
os: ubuntu-latest,
build_type: "Release",
cc: "gcc",
cxx: "g++",
generators: "Ninja",
}
- {
name: "ubuntu-clang",
os: ubuntu-latest,
artifact: "ubuntu-clang.7z",
build_type: "Release",
cc: "clang",
cxx: "clang++",
generators: "Ninja",
}
- {
name: "windows-msvc-vs2022",
os: windows-2022,
build_type: "Release",
cc: "cl",
cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
generators: "Visual Studio 17 2022"
}
- {
name: "macos-clang",
os: macos-latest,
build_type: "Release",
cc: "clang",
cxx: "clang++",
generators: "Ninja"
}
steps:
- uses: actions/checkout@v2
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install dependencies on windows
if: startsWith(matrix.config.os, 'windows')
run: |
cmake --version
- name: Install dependencies on ubuntu
if: startsWith(matrix.config.name, 'ubuntu')
run: |
sudo apt-get install ninja-build
ninja --version
cmake --version
gcc --version
- name: Install dependencies on macos
if: startsWith(matrix.config.os, 'macos')
run: |
brew install p7zip cmake ninja
ninja --version
cmake --version
- name: Configure
shell: bash
run: |
mkdir -p libelement.CLI/build
export CC=${{ matrix.config.CC }}
export CXX=${{ matrix.config.CXX }}
cmake \
-S libelement.CLI \
-B libelement.CLI/build \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-G "${{ matrix.config.generators }}"
- name: Build
shell: bash
run: cmake --build libelement.CLI/build --config ${{ matrix.config.build_type }}
- name: Upload Build Developer Logs
uses: actions/upload-artifact@v2
with:
name: '${{ matrix.config.name }}-build_dev_logs'
path: |
**/build/**/*.txt
**/build/**/*.gcda
**/build/**/*.gcno
**/build/**/*codecov*
**/build/**/*.xml
**/build/**/*.cmake
**/build/**/*.log
**/build/**/*.json
**/build/**/*.gcov
**/build/**/*.info
**/build/**/.*
!**/build/_deps
retention-days: 1
# Check source code formatting
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout submodules
shell: bash
run: |
# If your submodules are configured to use SSH instead of HTTPS please uncomment the following line
git config --global url."https://github.com/".insteadOf "[email protected]:"
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Install dependencies
run: |
sudo apt update
sudo apt install clang-format-9
- name: Run analysis
run: |
mkdir -p libelement.CLI/build
cmake \
-S libelement.CLI \
-B libelement.CLI/build \
..
# Run clang-format to see if code matches our style guide, clang-format target can be used to apply changes
cmake --build libelement.CLI/build --target element_cli_clang_check