Skip to content

Commit ecfba44

Browse files
authored
Merge pull request #1 from Guila767/add-CI
Refactor CI workflow for C/C++ builds and tests
2 parents e6df549 + 66b14c8 commit ecfba44

File tree

4 files changed

+74
-2
lines changed

4 files changed

+74
-2
lines changed

.github/workflows/c-cpp.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: C/C++ CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build-and-test:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [windows-latest]
15+
build_type: [Release]
16+
runs-on: ${{ matrix.os }}
17+
env:
18+
BUILD_TYPE: ${{ matrix.build_type }}
19+
CTEST_OUTPUT_ON_FAILURE: 1
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Config MSVC (Windows)
26+
if: runner.os == 'Windows'
27+
uses: ilammy/msvc-dev-cmd@v1
28+
29+
- name: Install ninja (Windows)
30+
if: runner.os == 'Windows'
31+
run: choco install -y ninja
32+
33+
- name: Setup python
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: '3.10.X'
37+
cache: 'pip'
38+
cache-dependency-path: '**/requirements.txt'
39+
40+
- name: Install python dependencies
41+
run: |
42+
python -m pip install --upgrade pip setuptools wheel
43+
pip install -r requirements.txt
44+
45+
- name: Configure (Windows)
46+
if: runner.os == 'Windows'
47+
run: |
48+
cmake -S . -B build -G Ninja `
49+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} `
50+
-DBUILD_TESTING=ON `
51+
-DBUILD_TESTS=ON `
52+
-DPROXY_ENABLE_LOG=ON `
53+
-DPROXY_LINK_MAP=ON `
54+
-DBUILD_LOADER=ON
55+
56+
- name: Build
57+
run: cmake --build build --config ${{ env.BUILD_TYPE }} -- -k 0
58+
59+
- name: Tests
60+
working-directory: build
61+
run: ctest -C ${{ env.BUILD_TYPE }}
62+
63+
- name: Upload build & tests logs
64+
if: always()
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: logs-${{ matrix.os }}-${{ env.BUILD_TYPE }}
68+
path: |
69+
build/Testing/Temporary/LastTest.log
70+
build/CMakeFiles/CMakeOutput.log
71+
build/CMakeFiles/CMakeError.log
72+
if-no-files-found: ignore

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pefile

tools/gen_def.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from pathlib import Path
77
from typing import NamedTuple, Optional, List, Literal
88

9-
109
import pefile
1110

1211
# ---------------------------

0 commit comments

Comments
 (0)