-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (58 loc) · 2.29 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
name: ci
on: [push, pull_request]
jobs:
ci:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: [macos, ubuntu, windows]
include:
- name: macos
os: macos-latest
compiler: gcc
version: "9"
vcpkg_triplet: x64-osx-libmw
- name: ubuntu
os: ubuntu-latest
vcpkg_triplet: x64-linux
- name: windows
os: windows-latest
vcpkg_triplet: x64-windows-static
steps:
- name: Checkout libmw
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: setup macos environment
if: runner.os == 'macOS'
run: |
brew install gcc cmake
echo "::set-env name=CC::gcc-${{ matrix.version }}"
echo "::set-env name=CXX::g++-${{ matrix.version }}"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Run vcpkg
uses: lukka/run-vcpkg@v6
with:
# Response file stored in source control, it provides the list of ports and triplet(s).
vcpkgArguments: '--debug --overlay-triplets=${{ github.workspace }}/vcpkg/triplets --triplet ${{ matrix.vcpkg_triplet }} @${{ github.workspace }}/vcpkg/packages.txt'
# Location of the vcpkg as submodule of the repository.
vcpkgDirectory: '${{ github.workspace }}/vcpkg/vcpkg'
# Since the cache must be invalidated when content of the response file changes, let's
# compute its hash and append this to the computed cache's key.
appendedCacheKey: ${{ hashFiles('${{ github.workspace }}/vcpkg/packages.txt') }}
- name: 'Run CMake'
uses: lukka/[email protected]
with:
cmakeGenerator: ${{ matrix.cmake_generator }}
cmakeBuildType: 'Release'
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
useVcpkgToolchainFile: true
vcpkgTriplet: '${{ matrix.vcpkg_triplet }}'
buildDirectory: '${{ github.workspace }}/build'
cmakeAppendedArgs: ' ${{ matrix.cmake_platform_args }} -DCMAKE_BUILD_TYPE=Release'
buildWithCMake: true
buildWithCMakeArgs: '--parallel --config Release'