-
Notifications
You must be signed in to change notification settings - Fork 72
121 lines (107 loc) · 4.73 KB
/
builds.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
name: Builds
on:
# Do it on every push or PR on these branches
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Do build on demand
workflow_dispatch:
jobs:
build:
# 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
name: "${{matrix.title}} (${{matrix.cc}}, ${{matrix.arch}}, ${{matrix.build_type}})"
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
include:
- { title: "Linux", os: "ubuntu-latest", cc: "clang", arch: "x64", build_type: "Release", package_type: "x64-linux", script: "sh" }
- { title: "Linux", os: "ubuntu-latest", cc: "clang", arch: "x64", build_type: "Debug", package_type: "x64-linux", script: "sh" }
- { title: "Linux", os: "ubuntu-latest", cc: "gcc", cxx: "g++", arch: "x64", build_type: "Release", package_type: "x64-linux", script: "sh" }
- { title: "Linux", os: "ubuntu-latest", cc: "gcc", cxx: "g++", arch: "x64", build_type: "Debug", package_type: "x64-linux", script: "sh" }
- { title: "Windows", os: "windows-latest", cc: "vs2022", arch: "x64", build_type: "Release", package_type: "x64-windows-static-md", script: "bat" }
- { title: "Windows", os: "windows-latest", cc: "vs2022", arch: "x64", build_type: "Debug", package_type: "x64-windows-static-md", script: "bat" }
- { title: "Mac", os: "macos-latest", cc: "clang", cxx: "clang++", arch: "x64", build_type: "Release", package_type: "x64-osx", script: "sh" }
- { title: "Mac", os: "macos-latest", cc: "clang", cxx: "clang++", arch: "x64", build_type: "Debug", package_type: "x64-osx", script: "sh" }
#- { title: "Coverage", os: "ubuntu-latest", cc: "clang", cxx: "clang++", arch: "x64", build_type: "Coverage", package_type: "x64-linux", script: "sh" }
steps:
- uses: actions/checkout@v2
- name: Install dependencies on ubuntu
run: |
sudo apt-get update
sudo apt-get install cmake
cmake --version
gcc --version
if: matrix.title == 'Linux'
- name: Install dependencies on macos
run: |
brew install cmake
cmake --version
if: matrix.title == 'Mac'
- name: Install GL
env:
CC: ${{ matrix.cc}}
run: |
sudo apt-get install freeglut3-dev
sudo apt-get install lcov
if: matrix.os == 'ubuntu-latest'
- name: Build
working-directory: ${{github.workspace}}
run: |
git submodule update --init
./prebuild.${{matrix.script}}
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build . --config ${{ matrix.build_type }}
if: matrix.build_type != 'Coverage'
- name: Build (Coverage)
working-directory: ${{github.workspace}}
run: |
git submodule update --init
./prebuild.${{matrix.script}}
mkdir build
cd build
cmake .. -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build . --config Debug
if: matrix.build_type == 'Coverage'
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -C ${{ matrix.build_type }}
- name: Coverage
working-directory: ${{github.workspace}}/build
shell: bash
if: matrix.build_type == 'Coverage'
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: |
bash <(curl -s https://codecov.io/bash)
find .. -name *.gcno | xargs gcov
lcov -c -d .. -o coverage.info
lcov --remove coverage.info '/usr/local/include/*' '/usr/include/*' 'build' 'm3rdparty' 'cmake' 'scripts' -o coverage.info
genhtml coverage.info
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.info
- name: Archive Coverage HTML
uses: actions/upload-artifact@v2
if: matrix.build_type == 'Coverage'
with:
name: Coverag_Report
path: |
${{github.workspace}}/build/**/*.html
${{github.workspace}}/build/**/*.css
- name: Archive Binary
uses: actions/upload-artifact@v2
with:
name: Archive_${{matrix.title}}_${{matrix.build_type}}
path: |
!${{github.workspace}}/**/CMakeFiles/**
${{github.workspace}}/build/**/*.exe
${{github.workspace}}/build/**/*.app
${{github.workspace}}/build/**/ZepDemo
${{github.workspace}}/build/**/ZepDemo-qt
${{github.workspace}}/build/**/unittests