Skip to content

Commit 736586b

Browse files
CI: Optimize matrix and use arm64 runners.
Previous commit does not work at all. A xxx-arm value in `runs-on` is needed to get a arm64 runner.
1 parent 594239d commit 736586b

File tree

1 file changed

+33
-82
lines changed

1 file changed

+33
-82
lines changed
Lines changed: 33 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
2-
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
31
name: Build patcher for multi platforms.
42

53
on:
@@ -8,39 +6,43 @@ on:
86
pull_request:
97
branches: [ "main" ]
108
workflow_dispatch:
11-
9+
1210
jobs:
1311
build:
1412
runs-on: ${{ matrix.os }}
1513
strategy:
16-
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
1714
fail-fast: false
18-
19-
# Set up a matrix to run the following 3 configurations:
20-
# 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator>
21-
# 2. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator>
22-
#
23-
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
2415
matrix:
25-
os: [ubuntu-latest, windows-latest, macos-latest]
26-
arch: [x86_64, aarch64]
27-
build_type: [Release]
28-
c_compiler: [clang, cl]
2916
include:
17+
# Windows x86_64
3018
- os: windows-latest
19+
arch: x86_64
20+
c_compiler: cl
21+
cpp_compiler: cl
22+
23+
# Windows ARM64
24+
- os: windows-11-arm
25+
arch: aarch64
3126
c_compiler: cl
3227
cpp_compiler: cl
28+
29+
# Linux x86_64
3330
- os: ubuntu-latest
31+
arch: x86_64
3432
c_compiler: clang
35-
exclude:
36-
- os: windows-latest
33+
cpp_compiler: clang
34+
35+
# Linux ARM64
36+
- os: ubuntu-24.04-arm
37+
arch: aarch64
3738
c_compiler: clang
38-
- os: ubuntu-latest
39-
c_compiler: cl
40-
- os: macos-latest
41-
c_compiler: cl
39+
cpp_compiler: clang
40+
41+
# macOS x86_64
4242
- os: macos-latest
43-
arch: aarch64
43+
arch: x86_64
44+
c_compiler: clang
45+
cpp_compiler: clang
4446

4547
steps:
4648
- uses: actions/checkout@v4
@@ -50,79 +52,28 @@ jobs:
5052
shell: bash
5153
run: |
5254
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
53-
echo >> $GITHUB_ENV
54-
55+
5556
- name: Configure Compiler
56-
if: ${{ matrix.os == 'ubuntu-latest' }}
57+
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm' }}
5758
run: |
5859
sudo apt install gcc-aarch64-linux-gnu
5960
echo -e \\nset\(CMAKE_C_FLAGS "--target=${{ matrix.arch }}-linux-gnu"\) \\n >> ${{ github.workspace }}/CMakeLists.txt
60-
61+
6162
- name: Configure CMake
6263
run: >
6364
cmake -B ${{ steps.strings.outputs.build-output-dir }}
6465
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
6566
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
66-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
67+
-DCMAKE_BUILD_TYPE=Release
6768
-S ${{ github.workspace }}
6869
69-
- name: Build Patcher.
70-
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --target DualBootKernelPatcher
70+
- name: Build Patcher
71+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release --target DualBootKernelPatcher
7172

72-
- name: Upload Windows X86_64 Artifact
73+
- name: Upload Artifact
7374
uses: actions/upload-artifact@v4
74-
if: ${{ matrix.arch == 'x86_64' && matrix.os == 'windows-latest' }}
7575
with:
76-
name: DualBootKernelPatcher-Windows-X86_64
76+
name: DualBootKernelPatcher-${{ matrix.os }}-${{ matrix.arch }}
7777
path: |
78-
${{ steps.strings.outputs.build-output-dir }}/**/DualBootKernelPatcher.exe
79-
${{ steps.strings.outputs.build-output-dir }}/**/DualBootKernelRemover.exe
80-
81-
- name: Upload Linux X86_64 Artifact
82-
uses: actions/upload-artifact@v4
83-
if: ${{ matrix.arch == 'x86_64' && matrix.os == 'ubuntu-latest' }}
84-
with:
85-
name: DualBootKernelPatcher-Linux-X86_64
86-
path: |
87-
${{ steps.strings.outputs.build-output-dir }}/DualBootKernelPatcher
88-
${{ steps.strings.outputs.build-output-dir }}/DualBootKernelRemover
89-
90-
- name: Upload MacOS X86_64 Artifact
91-
uses: actions/upload-artifact@v4
92-
if: ${{ matrix.arch == 'x86_64' && matrix.os == 'macos-latest' }}
93-
with:
94-
name: DualBootKernelPatcher-MacOS-X86_64
95-
path: |
96-
${{ steps.strings.outputs.build-output-dir }}/DualBootKernelPatcher
97-
${{ steps.strings.outputs.build-output-dir }}/DualBootKernelRemover
98-
99-
- name: Upload Linux ARM64 Artifact
100-
uses: actions/upload-artifact@v4
101-
if: ${{ matrix.arch == 'aarch64' && matrix.os == 'ubuntu-latest' }}
102-
with:
103-
name: DualBootKernelPatcher-Linux-ARM64
104-
path: |
105-
${{ steps.strings.outputs.build-output-dir }}/DualBootKernelPatcher
106-
${{ steps.strings.outputs.build-output-dir }}/DualBootKernelRemover
107-
108-
- name: Upload Windows ARM64 Artifact
109-
uses: actions/upload-artifact@v4
110-
if: ${{ matrix.arch == 'aarch64' && matrix.os == 'windows-latest' }}
111-
with:
112-
name: DualBootKernelPatcher-Windows-ARM64
113-
path: |
114-
${{ steps.strings.outputs.build-output-dir }}/**/DualBootKernelPatcher.exe
115-
${{ steps.strings.outputs.build-output-dir }}/**/DualBootKernelRemover.exe
116-
117-
- name: Build shellcodes.
118-
if: ${{ matrix.arch == 'aarch64' && matrix.os == 'ubuntu-latest' }}
119-
run: |
120-
sudo apt install binutils-aarch64-linux-gnu
121-
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --target all
122-
123-
- name: Upload ShellCode Artifact
124-
uses: actions/upload-artifact@v4
125-
if: ${{ matrix.arch == 'aarch64' && matrix.os == 'ubuntu-latest' }}
126-
with:
127-
name: Shellcodes
128-
path: ${{ steps.strings.outputs.build-output-dir }}/ShellCode/*.bin
78+
${{ steps.strings.outputs.build-output-dir }}/**/DualBootKernelPatcher*
79+
${{ steps.strings.outputs.build-output-dir }}/**/DualBootKernelRemover*

0 commit comments

Comments
 (0)