-
Notifications
You must be signed in to change notification settings - Fork 11
80 lines (66 loc) · 2.25 KB
/
feature.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
name: Feature
on:
pull_request:
branches:
- main
jobs:
build_feature:
name: Build ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
name: linux
dir_build: ./build
file_name: clap-info
run_test: true
- os: macos-latest
name: mac-universal
dir_build: ./build
file_name: clap-info
cmake_args: -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
run_test: true
- os: windows-latest
name: win-x64
dir_build: ./build/Release
file_name: clap-info
file_ext: .exe
cmake_args: -G"Visual Studio 17 2022" -A x64
run_test: true
- os: windows-latest
name: win-arm64ec
dir_build: ./build/Release
file_name: clap-info
file_ext: .exe
cmake_args: -G"Visual Studio 17 2022" -A arm64ec -DCMAKE_SYSTEM_VERSION=10
run_test: false
steps:
- name: Install Windows dependencies
if: matrix.os == 'windows-latest'
run: choco install zip
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build binary
run: |
cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_args }}
cmake --build ./build --config Release
- name: List files
run: ls "${{ matrix.dir_build }}"
- name: Test binary
if: ${{ matrix.run_test }}
run: ${{ matrix.dir_build }}/${{ matrix.file_name }}${{ matrix.file_ext }} -h
- name: Windows Dumpbin
if: matrix.os == 'windows-latest'
run: dumpbin.exe ${{ matrix.dir_build }}/${{ matrix.file_name }}${{ matrix.file_ext }}
- name: Compress binary
run: |
cd "${{ matrix.dir_build }}"
zip ${{ matrix.file_name }}-${{ matrix.name }}.zip ${{ matrix.file_name }}${{ matrix.file_ext }}
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.file_name }}-${{ matrix.name }}.zip
path: ${{ matrix.dir_build }}/${{ matrix.file_name }}-${{ matrix.name }}.zip