-
Notifications
You must be signed in to change notification settings - Fork 1
104 lines (85 loc) · 3.21 KB
/
Copy pathBuild.yml
File metadata and controls
104 lines (85 loc) · 3.21 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
name: Build
on:
push:
paths:
- '.github/workflows/Build.yml'
- 'Source/**'
- '**.cmake'
pull_request:
defaults:
run:
shell: bash
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, artifact: ReDefine-Linux }
- { os: ubuntu-latest, name: GNU, cc: gcc, cxx: g++, platform: x64, redefine: Build/ReDefine, artifact: none }
- { os: ubuntu-latest, name: Clang, cc: clang, cxx: clang++, platform: x32, redefine: Build/ReDefine, artifact: none }
- { os: ubuntu-latest, name: Clang, cc: clang, cxx: clang++, platform: x64, redefine: Build/ReDefine, artifact: none }
# https://github.com/actions/virtual-environments/issues/68
# { os: windows-2016, name: VS2017, cc: cl, cxx: cl, platform: x32, redefine: Build/Release/ReDefine.exe, artifact: none }
# { os: windows-2016, name: VS2017, cc: cl, cxx: cl, platform: x64, redefine: Build/Release/ReDefine.exe, artifact: none }
- { os: windows-2019, name: VS2019, cc: cl, cxx: cl, platform: x32, redefine: Build/Release/ReDefine.exe, artifact: ReDefine-Windows }
- { os: windows-2019, name: VS2019, cc: cl, cxx: cl, platform: x64, redefine: Build/Release/ReDefine.exe, artifact: none }
steps:
# required by gcc *and* clang
- name: Install additional software
if: runner.os == 'Linux' && matrix.cfg.platform == 'x32'
run: sudo apt update && sudo apt install -y gcc-multilib g++-multilib && hash -r
- name: Clone repository
uses: actions/checkout@v2
- 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 }}
mkdir -p ReDefine
cp ${{ matrix.cfg.redefine }} ReDefine
- name: Test
run: cmake --build Build --config Release --target ReDefine.Test
- name: Artifact
if: matrix.cfg.artifact != 'none'
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.cfg.artifact }}
path: ReDefine
##
Scan:
needs: Build
runs-on: ubuntu-latest
steps:
- name: Install Clang tools
run: |
:
for cmd in "apt update" "apt search clang-tools" "apt remove -y libllvm8" "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@v2
- name: scan-build
run: scan-build-8 cmake -DBUILD_DIR=Build.ScanBuild -P Build.cmake || true
env:
CI: true
CC: clang
CXX: clang++
MATRIX_OS: ubuntu-latest
MATRIX_PLATFORM: x64
# - name: clang-tidy
# run: cmake -DBUILD_DIR=Build.ClangTidy -P Build.cmake
# env:
# CLANG_TIDY: clang-tidy-8