-
Notifications
You must be signed in to change notification settings - Fork 43
128 lines (113 loc) · 3.92 KB
/
build.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
name: Build binaries
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
name: ${{ matrix.platform }} / ${{ matrix.cpu }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest, ubuntu-latest ]
cpu: [ x64, x86, arm64, arm ]
exclude:
- os: windows-latest
cpu: x86
include:
- os: macos-13
platform: macos
cpu: universal
arch: any
cxx: c++
flags: '-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_CXX_FLAGS_RELEASE="-O2 -DNDEBUG"'
- os: windows-latest
platform: windows
cpu: Win32
arch: x86
cxx: cl
flags: '-DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /DNDEBUG" -A '
- os: windows-latest
cxx: cl
- os: ubuntu-latest
cpu: x64
cxx: g++
- os: ubuntu-latest
cpu: x86
apt: g++-i686-linux-gnu
cxx: /bin/i686-linux-gnu-g++
- os: ubuntu-latest
cpu: arm
apt: g++-arm-linux-gnueabihf
cxx: /bin/arm-linux-gnueabihf-g++
- os: ubuntu-latest
cpu: arm64
apt: g++-aarch64-linux-gnu
cxx: /bin/aarch64-linux-gnu-g++
- os: ubuntu-latest
flags: '-DCMAKE_CXX_FLAGS_RELEASE="-static -s -O2 -DNDEBUG"'
- os: windows-latest
flags: '-DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /DNDEBUG" -A '
- os: ubuntu-latest
platform: linux
- os: windows-latest
platform: windows
- cpu: x64
arch: x86_64
- cpu: x86
arch: x86
- cpu: arm64
arch: arm64
- cpu: arm
arch: arm32
steps:
- uses: actions/checkout@v3
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "bin=${{ github.workspace }}/bin" >> "$GITHUB_OUTPUT"
- name: Install compiler
if: ${{ matrix.apt }}
run: >
sudo apt -y install ${{ matrix.apt }}
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.bin }}
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }}
${{ matrix.flags }} ${{ matrix.os == 'windows-latest' && matrix.cpu || '' }}
-DCMAKE_BUILD_TYPE=Release
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.bin }} --config Release
- name: Test (POSIX)
if: matrix.os != 'windows-latest' && matrix.cpu != 'arm' && matrix.cpu != 'arm64'
run: ${{ steps.strings.outputs.bin }}/vtm -v
- name: Test AV (Windows)
if: matrix.os == 'windows-latest'
run: |
$fileName = "${{ steps.strings.outputs.bin }}/Release/vtm.exe"
$MpCmdRun = "C:\Program Files\Windows Defender\MpCmdRun.exe"
Set-Service -Name wuauserv -StartupType Manual -Status Running
Remove-MpPreference -ExclusionPath (Get-MpPreference).ExclusionPath
Set-MpPreference -MAPSReporting Advanced
& '7z' a -tzip c:\vtm.zip $fileName
& $MpCmdRun -SignatureUpdate
& $MpCmdRun -Scan -ScanType 3 -File c:\vtm.zip
- name: Pack (POSIX)
if: matrix.os != 'windows-latest'
run: 7z a -ttar vtm_${{ matrix.platform }}_${{ matrix.arch }}.tar ${{ steps.strings.outputs.bin }}/vtm
- name: Upload Artifact (POSIX)
if: matrix.os != 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: vtm_${{ matrix.platform }}_${{ matrix.arch }}
path: vtm_${{ matrix.platform }}_${{ matrix.arch }}.tar
- name: Upload Artifact (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: vtm_${{ matrix.platform }}_${{ matrix.arch }}
path: ${{ steps.strings.outputs.bin }}/Release/vtm.exe