-
Notifications
You must be signed in to change notification settings - Fork 951
143 lines (119 loc) · 4.08 KB
/
retdec-ci.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
139
140
141
142
143
## Configuration of Github Actions CI for RetDec
name: RetDec CI
on:
push:
branches:
- master # Activate CI on push on master.
- 'test-*' # Activate CI on branch with prefix test-.
pull_request:
branches:
- master # Activate on pull request.
env:
# Universal ENV variable containing path to all workflows scripts.
# Each OS has it's own directory there: Windows, macOS, Linux.
# Names of directories are compatible with the $RUNNER_OS variable.
WORKFLOWS_DIR: ${{ github.workspace }}/.github/workflows/
jobs:
ci-runner:
strategy:
matrix:
sys:
- { os: ubuntu-latest, shell: bash }
- { os: windows-2019, shell: 'msys2 {0}' }
- { os: macos-11, shell: bash }
type: [Release, Debug]
# Let other builds finish.
fail-fast: false
name: ${{ matrix.sys.os }} (${{ matrix.type }})
runs-on: ${{ matrix.sys.os }}
defaults:
run:
shell: ${{ matrix.sys.shell }}
steps:
# Checkouts the correct commit/branch.
- uses: actions/checkout@v3
# We want to use msys2 bash on Windows.
- uses: msys2/setup-msys2@v2
if: runner.os == 'Windows'
# Installs dependencies on all systems.
- name: Install Dependencies
run: bash "${WORKFLOWS_DIR}/${RUNNER_OS}/install-deps.sh"
shell: bash
- name: Windows Additional Packages
if: runner.os == 'Windows'
run: |
pacman -S mingw-w64-i686-gcc --noconfirm
pacman -S mingw-w64-x86_64-gcc --noconfirm
pacman -S mingw-w64-x86_64-python --noconfirm
pacman -S python3-pip --noconfirm
# Regression tests framework requires specific version of clang.
# The following script(s) prepares clang on each platform.
- name: Prepare Clang
run: bash "${WORKFLOWS_DIR}/${RUNNER_OS}/prepare-clang.sh"
env:
# Clang will be available in build/clang
CLANG_DIR_OUT: clang
shell: bash
- name: Build RetDec
run: bash "${WORKFLOWS_DIR}/${RUNNER_OS}/build.sh"
env:
BUILD_TYPE: ${{ matrix.type }}
shell: bash
- name: Prepare RetDec Regression Tests & Framework
run: bash "${WORKFLOWS_DIR}/common/prepare-retdec-tests.sh"
shell: bash
- name: Run Tests
run: bash "${WORKFLOWS_DIR}/${RUNNER_OS}/run-tests.sh" "${WORKFLOWS_DIR}/${RUNNER_OS}/ignore_${{ matrix.type }}"
# Prepare files for publishing/release. The resulting structure:
# RetDec-OSType-Release
# |_ bin
# |_ include
# |_ lib
# |_ share
# | \__ retdec/support/
# |
# |_ CHANGELOG.md
# |_ LICENSE
# |_ LICENSE-THIRD-PARTY
# \_ README.md
- name: Prepare Files for Publishing
if: matrix.type == 'Release'
run: |
cp LICENSE* install/
cp CHANGELOG.md install/
cp README.md install/
- name: Archive Artifacts
if: matrix.type == 'Release'
uses: actions/upload-artifact@v1
with:
name: RetDec-${{ runner.os }}-Release
path: install
docs-build:
name: doxygen-build (Linux)
runs-on: ubuntu-latest
steps:
# Checkouts the correct commit/branch.
- uses: actions/checkout@v3
# Installs dependencies on all systems.
- name: Install Dependencies
run: bash "${WORKFLOWS_DIR}/Linux/install-deps.sh"
shell: bash
- name: Build Docs
run: |
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=install -DRETDEC_DOC=ON
make doc -j$(nproc)
- name: Display Docs Warnings
run: |
file="build/doc/doxygen/doxygen.log"
echo "checking file: $file"
content="$(cat $file)"
if [ "$content" = "" ]; then
echo "===> ok"
else
echo "===> fail:"
echo "=========================================="
echo "$content"
echo "=========================================="
exit 0
fi