-
Notifications
You must be signed in to change notification settings - Fork 0
192 lines (173 loc) · 5.74 KB
/
ci-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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: ci-cli
env:
SRC: unvivtool.c
DEST: unvivtool
BRANCHES: #-DUVTUTF8
GCCFLAGS: -fPIE -D_FORTIFY_SOURCE=2 -fstack-clash-protection -fstack-protector-strong -D_GNU_SOURCE
CPPFLAGS: -D_GLIBCXX_ASSERTIONS -fPIE -Wl,-pie -fstack-clash-protection -fstack-protector-strong -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE # -pie
CPPFLAGS_MACOS: -D_GLIBCXX_ASSERTIONS -fPIE -Wl,-pie -fstack-protector-strong -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE # -pie
GCCDEBUGFLAGS: -pedantic -Og -g -Wall -Wextra -Wstack-protector -fasynchronous-unwind-tables
CPPDEBUGFLAGS: -Og -g -Wall -Wextra -Wstack-protector -fasynchronous-unwind-tables
on:
[push, pull_request]
jobs:
linux:
runs-on: ubuntu-latest
name: Ubuntu C89/C++
steps:
- uses: actions/checkout@v4
- name: Compile
shell: bash
run: |
gcc -std=c89 ${{ env.GCCFLAGS }} "${{ env.SRC }}" -o "${{ env.DEST }}" ${{ env.GCCDEBUGFLAGS }} ${{ env.BRANCHES }}
g++ -std=c++17 ${{ env.CPPFLAGS }} "${{ env.SRC }}" -o "${{ env.DEST }}_c++" ${{ env.CPPDEBUGFLAGS }} ${{ env.BRANCHES }}
clang -std=c89 ${{ env.GCCFLAGS }} "${{ env.SRC }}" -o "${{ env.DEST }}_clang" ${{ env.GCCDEBUGFLAGS }} ${{ env.BRANCHES }} -Wno-embedded-directive
clang++ -std=c++17 ${{ env.CPPFLAGS }} "${{ env.SRC }}" -o "${{ env.DEST }}_clang_c++" ${{ env.CPPDEBUGFLAGS }} ${{ env.BRANCHES }} -Wno-embedded-directive
ls -lg
- name: Store executables
uses: actions/upload-artifact@v4
with:
name: unvivtool
path: |
${{ env.DEST }}
${{ env.DEST }}_c++
${{ env.DEST }}_clang
${{ env.DEST }}_clang_c++
macos:
runs-on: macos-latest
name: macOS C89/C++
steps:
- uses: actions/checkout@v4
- name: Compile
shell: bash
run: |
clang -std=c89 "${{ env.SRC }}" -o "${{ env.DEST }}_${{ runner.os }}" ${{ env.GCCDEBUGFLAGS }} ${{ env.BRANCHES }}
clang++ -std=c++17 ${{ env.CPPFLAGS_MACOS }} "${{ env.SRC }}" -o "${{ env.DEST }}_${{ runner.os }}_c++" ${{ env.CPPDEBUGFLAGS }} ${{ env.BRANCHES }}
ls -lg
- name: Store executables
uses: actions/upload-artifact@v4
with:
name: unvivtool_${{ runner.os }}
path: |
${{ env.DEST }}_${{ runner.os }}
${{ env.DEST }}_${{ runner.os }}_c++
windows:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest ]
arch: [ x86, x64 ]
name: Windows (MSVC ${{ matrix.arch }})
steps:
- uses: actions/checkout@v4
- name: Setup Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Compile
run: |
cl.exe /W4 /utf-8 /O2 /TC unvivtool.c /Fe:unvivtool_${{ matrix.arch }}.exe /wd4267 /wd4996
dir
- name: Store executable
uses: actions/upload-artifact@v4
with:
name: unvivtool_${{ matrix.arch }}.exe
path: unvivtool_${{ matrix.arch }}.exe
test-linux:
runs-on: ${{ matrix.os }}
env:
valgrind: "valgrind -v --leak-check=full --show-leak-kinds=all --track-origins=yes"
needs:
- linux
- macos
- windows
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.12" ]
std: [ "", "_c++" ]
name: Test ${{ matrix.os }} ${{ matrix.std }} (Python ${{ matrix.python-version }})
steps:
- uses: actions/checkout@v4
- name: Download executable
uses: actions/download-artifact@v4
with:
name: unvivtool
- run: ls -lg
- run: chmod +x unvivtool${{ matrix.std }}
- name: Install valgrind
shell: bash
run: |
sudo apt update
sudo apt install valgrind --fix-missing
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: "pytest"
shell: bash
run: |
python -m pip install -q pytest
pytest ./tests/test_cli_decodeencode${{ matrix.std }}.py -vvs
test-macos:
runs-on: ${{ matrix.os }}
needs:
- linux
- macos
- windows
strategy:
fail-fast: false
matrix:
os: [ macos-latest ]
python-version: [ "3.12" ]
std: [ "", "_c++" ]
name: Test ${{ matrix.os }} ${{ matrix.std }} (Python ${{ matrix.python-version }})
steps:
- uses: actions/checkout@v4
- name: Download executable
uses: actions/download-artifact@v4
with:
name: unvivtool_${{ runner.os }}
- run: ls -lg
- run: chmod +x unvivtool_${{ runner.os }}${{ matrix.std }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: "pytest"
shell: bash
run: |
ls -lg
python -m pip install -q pytest
pytest ./tests/test_cli_decodeencode${{ matrix.std }}.py -vvs
test-windows:
runs-on: ${{ matrix.os }}
needs:
- linux
- macos
- windows
strategy:
fail-fast: false
matrix:
os: [ windows-latest ]
arch: [ x86, x64 ]
python-version: [ "3.12" ]
name: Test ${{ matrix.os }} ${{ matrix.arch }} (python-${{ matrix.python-version }})
steps:
- uses: actions/checkout@v4
- name: Download executable
uses: actions/download-artifact@v4
with:
name: unvivtool_${{ matrix.arch }}.exe
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.arch }}
- name: "pytest"
shell: bash
run: |
python -m pip install -q pytest
pytest ./tests/test_cli_decodeencode.py -vvs