-
Notifications
You must be signed in to change notification settings - Fork 4
93 lines (81 loc) · 2.77 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
# (DONE) find a way to add SDL2 to the build system.
# (DONE) find a way to check if there is a new version of the dependencies and update automatically.
# (DONE) handle vcpkg actions better.
# (DONE) consider building all the dependencies in a single action.
# (DONE) using env: set vcpkg triplet to x64.
# (DONE) build vcpkg on macosx after downloading.
# (DONE) add more os-es and more build configurations.
# (DONE) actions/cache knows there is some cache saved, but still runs downlod process.
# TODO:
# 1. The runner on Windows doesn't know the location of vcvars64.bat. Add that to the PATH using env:.
# 2. Use PVS-Studio for static analysis on every commit.
# 3. Move containings of assets folder to the binary folder.
# 4. Add support for x86 builds.
# Thx Cristian Adam
# https://cristianadam.eu/20191222/using-github-actions-with-c-plus-plus-and-cmake/
name: build
on: ["push", "pull_request"]
env:
VCPKG_FEATURE_FLAGS: manifests,binarycaching
jobs:
check-code:
name: Check code quality
runs-on: windows-latest
steps:
- name: IntelliCode Team Completions
uses: microsoft/[email protected]
with:
platform: Any CPU
config: Release
id: intelli-check
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: "Windows"
artifact: "Windows-MSVC.zip"
os: windows-latest
build_type: "Release"
triplet: 'x64-windows'
vcpkg-path: "C:\\vcpkg"
extra: yasm
script-ext: '.bat'
mono: ''
- name: "Ubuntu"
artifact: "Linux.tar.xz"
os: ubuntu-latest
build-type: "Release"
triplet: 'x64-linux'
vcpkg-path: "/usr/local/share/vcpkg"
extra: ''
script-ext: '.sh'
mono: 'mono'
- name: "MacOS"
artifact: "Mac.tar.xz"
os: macos-latest
build_type: "Release"
triplet: 'x64-osx'
vcpkg-path: "/usr/local/share/vcpkg"
extra: ''
script-ext: '.sh'
mono: 'mono'
steps:
- uses: actions/checkout@v1
- name: Generate project
run: |
mkdir build
cmake -Bbuild . -DCMAKE_TOOLCHAIN_FILE=${{ matrix.config.vcpkg-path }}/scripts/buildsystems/vcpkg.cmake
- name: Build project
run: cmake --build . --target TnTEditor --config Release
- name: Install
run: cmake --install build
- name: Pack
run: cmake -E tar cJfv ../${ { matrix.config.artifact } } .
- name: Upload
uses: actions/upload-artifact@v1
with:
path: ./${ { matrix.config.artifact } }
name: ${ { matrix.config.artifact } }