-
Notifications
You must be signed in to change notification settings - Fork 15
72 lines (72 loc) · 2.22 KB
/
ci.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
name: CI
on: [push, pull_request]
env:
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/_vcpkg_cache
jobs:
build:
runs-on: ["${{ matrix.image }}"]
strategy:
matrix:
os: [linux, mac, windows]
include:
- os: linux
image: ubuntu-latest
- os: mac
image: macOS-latest
- os: windows
image: windows-latest
cmake_args: -A x64
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Create vcpkg cache directory
run: mkdir _vcpkg_cache
- name: Cache node modules
uses: actions/cache@v2
env:
cache_name: vcpkg
with:
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
key: ${{ runner.os }}-build-${{ env.cache_name }}-${{ hashFiles('vcpkg.cmake', 'vcpkg.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache_name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies (linux)
if: matrix.os == 'linux'
run: curl -sSL https://cmake.org/files/v3.18/cmake-3.18.5-Linux-x86_64.tar.gz -o - | sudo tar xzf - --strip-components 1 -C /usr/local
- name: CMake version
run: cmake --version
- name: Configure
run: cmake -S . -B _build -DCMAKE_BUILD_TYPE=RelWithDebInfo ${{ matrix.cmake_args }}
- name: Build
run: cmake --build _build --config RelWithDebInfo
- name: Prepare artifacts (linux)
if: matrix.os == 'linux'
run: |
mkdir _bin
cd _bin
cp ../_build/BtMigrate .
objcopy --only-keep-debug BtMigrate BtMigrate.debug
objcopy --add-gnu-debuglink=BtMigrate.debug BtMigrate
strip -x BtMigrate
- name: Prepare artifacts (mac)
if: matrix.os == 'mac'
run: |
mkdir _bin
cd _bin
cp ../_build/BtMigrate .
dsymutil -f BtMigrate
strip -x BtMigrate
- name: Prepare artifacts (windows)
if: matrix.os == 'windows'
run: |
mkdir _bin
cd _bin
copy ..\_build\RelWithDebInfo\BtMigrate.exe .
copy ..\_build\RelWithDebInfo\BtMigrate.pdb .
- uses: actions/upload-artifact@v1
with:
name: ${{ matrix.os }}-binaries
path: _bin