-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (85 loc) · 2.95 KB
/
Build.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
name: Build
on:
push:
paths:
- '.github/workflows/Build.yml'
- 'Source/**'
- '**.cmake'
pull_request:
jobs:
Build:
runs-on: ${{ matrix.cfg.os }}
name: ${{ matrix.cfg.name }} (${{ matrix.cfg.platform }})
strategy:
fail-fast: false
matrix:
cfg:
- { os: ubuntu-latest, name: GNU, cc: gcc, cxx: g++, platform: x32, redefine: Build/ReDefine }
- { os: ubuntu-latest, name: GNU, cc: gcc, cxx: g++, platform: x64, redefine: Build/ReDefine }
- { os: ubuntu-latest, name: Clang, cc: clang, cxx: clang++, platform: x32, redefine: Build/ReDefine }
- { os: ubuntu-latest, name: Clang, cc: clang, cxx: clang++, platform: x64, redefine: Build/ReDefine }
- { os: windows-2016, name: VS2017, cc: cl, cxx: cl, platform: x32, redefine: Build/Release/ReDefine.exe }
- { os: windows-2016, name: VS2017, cc: cl, cxx: cl, platform: x64, redefine: Build/Release/ReDefine.exe }
- { os: windows-2019, name: VS2019, cc: cl, cxx: cl, platform: x32, redefine: Build/Release/ReDefine.exe }
- { os: windows-2019, name: VS2019, cc: cl, cxx: cl, platform: x64, redefine: Build/Release/ReDefine.exe }
steps:
# required by gcc *and* clang
- name: Install additional software
if: runner.os == 'Linux' && matrix.cfg.platform == 'x32'
run: sudo apt install -y gcc-multilib g++-multilib && hash -r
- name: Clone repository
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Build
run: cmake -P Build.cmake
env:
CI: true
CC: ${{ matrix.cfg.cc }}
CXX: ${{ matrix.cfg.cxx }}
MATRIX_OS: ${{ matrix.cfg.os }}
MATRIX_PLATFORM: ${{ matrix.cfg.platform }}
- name: Build check
run: |
:
file ${{ matrix.cfg.redefine }}
ldd ${{ matrix.cfg.redefine }}
shell: bash
##
Scan:
needs: Build
runs-on: ubuntu-latest
steps:
- name: Install Clang tools
run: |
:
for cmd in "apt update" "apt search clang-tools" "apt install clang-tools-8 clang-tidy-8"; do
echo ::group::$cmd
sudo $cmd 2>&1
echo ::endgroup::
done
- name: Clone repository
uses: actions/checkout@master
with:
fetch-depth: 1
- name: scan-build
run: scan-build-8 cmake -DBUILD_DIR=Build.ScanBuild -P Build.cmake
- name: clang-tidy
run: cmake -DBUILD_DIR=Build.ClangTidy -P Build.cmake
env:
CLANG_TIDY: clang-tidy-8
# - name: Prepare artifact
# if: matrix.cfg.os == 'windows-2016' && matrix.cfg.platform == 'x32'
# run: |
# :
# 7z a ReDefine.zip $GITHUB_WORKSPACE/${{ matrix.cfg.redefine }}
# 7z a ReDefine.zip Source
# 7z l ReDefine.zip
# shell: bash
#
# - name: Upload artifact
# if: runner.os == 'Windows' && matrix.cfg.platform == 'x32'
# uses: actions/upload-artifact@master
# with:
# name: ReDefine
# path: ReDefine.zip