-
Notifications
You must be signed in to change notification settings - Fork 21
181 lines (178 loc) · 5.91 KB
/
tec.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: Trillek Engine CI
on:
pull_request:
push:
tags: [v*]
branches:
- master
# Add concurrency group to cancel in-progress runs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
[
windows-latest,
windows-2019,
ubuntu-latest,
ubuntu-20.04,
macOS-latest,
]
arch: [x86, x64]
include:
- os: windows-latest
vcpkgTripletOs: windows
- os: windows-2019
vcpkgTripletOs: windows
- os: ubuntu-latest
vcpkgTripletOs: linux
- os: ubuntu-20.04
vcpkgTripletOs: linux
- os: macOS-latest
vcpkgTripletOs: osx
exclude:
- os: ubuntu-latest
arch: x86
- os: ubuntu-20.04
arch: x86
- os: macOS-latest
arch: x86
env:
buildDir: "${{ github.workspace }}/build"
BUILD_PRESET: release
CONFIG_PRESET: ninja-multi-vcpkg-ci
VCPKG_COMMIT_ID: 10b7a178346f3f0abef60cecd5130e295afd8da4
VCPKG_DEFAULT_TRIPLET: ${{ matrix.arch }}-${{ matrix.vcpkgTripletOs }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: lukka/get-cmake@latest
- name: Install os deps (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install libgl1-mesa-dev xorg-dev libglu1-mesa-dev libxinerama-dev libxcursor-dev p7zip-full -y
- name: Restore artifacts, or run vcpkg, build and cache artifacts
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }}
- name: Configure cmake and build
uses: lukka/run-cmake@v10
with:
configurePreset: ${{ env.CONFIG_PRESET }}
buildPreset: ${{ env.CONFIG_PRESET }}-${{ env.BUILD_PRESET }}
testPreset: ${{ env.CONFIG_PRESET }}-${{ env.BUILD_PRESET }}
- name: Upload the build artifact
uses: actions/upload-artifact@v3
with:
name: "trillek-${{ matrix.os }}"
path: |
assets/
${{ env.CLIENT_BUILD_DIR }}/trillek-client
${{ env.CLIENT_BUILD_DIR }}/trillek-client.exe
${{ env.CLIENT_BUILD_DIR }}/*.dll
${{ env.SERVER_BUILD_DIR }}/trillek-serverd
${{ env.SERVER_BUILD_DIR }}/trillek-server.exe
if-no-files-found: ignore
env:
CLIENT_BUILD_DIR: ${{ github.workspace }}/builds/${{ env.CONFIG_PRESET }}/client/Release
SERVER_BUILD_DIR: ${{ github.workspace }}/builds/${{ env.CONFIG_PRESET }}/server/Release
coverage:
runs-on: windows-latest
env:
buildDir: "${{ github.workspace }}/build"
BUILD_PRESET: debug
CONFIG_PRESET: ninja-multi-vcpkg-ci
VCPKG_COMMIT_ID: 10b7a178346f3f0abef60cecd5130e295afd8da4
VCPKG_DEFAULT_TRIPLET: x64-windows
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: lukka/get-cmake@latest
- name: Restore artifacts, or run vcpkg, build and cache artifacts
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }}
- name: Configure cmake and build
uses: lukka/run-cmake@v10
with:
configurePreset: ${{ env.CONFIG_PRESET }}
buildPreset: ${{ env.CONFIG_PRESET }}-${{ env.BUILD_PRESET }}
- name: Setup OpenCppCoverage and add to PATH
id: setup_opencppcoverage
run: |
choco install OpenCppCoverage -y
echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH
- name: Generate Report
id: generate_test_report
shell: cmd
run: OpenCppCoverage.exe --quiet --config_file opencppcovconfig.txt --export_type cobertura:coverage.xml -- ctest.exe --preset ${{ env.CONFIG_PRESET }}-${{ env.BUILD_PRESET }}
- name: Upload Report to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
fail_ci_if_error: true
functionalities: fix
token: ${{ secrets.CODECOV_TOKEN }}
prepublish:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v')
name: Create Release
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "${{ github.ref }}"
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
publish:
runs-on: ubuntu-latest
needs: prepublish
strategy:
fail-fast: false
matrix:
os:
[
windows-latest,
windows-2016,
ubuntu-latest,
ubuntu-20.04,
macOS-latest,
]
arch: [x64]
if: startsWith(github.ref, 'refs/tags/v')
name: Upload Release Asset(s)
steps:
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: "trillek-${{ matrix.os }}"
- name: Package release
run: |
zip --junk-paths -r -u trillek-${{ matrix.os }}.zip build/client
zip --junk-paths -r -u trillek-${{ matrix.os }}.zip build/server
zip -r -u trillek-${{ matrix.os }}.zip assets/
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.prepublish.outputs.upload_url }}
asset_path: "./trillek-${{ matrix.os }}.zip"
asset_name: "trillek-${{ matrix.os }}.zip"
asset_content_type: application/zip