-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (127 loc) · 4.54 KB
/
build_ship.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
name: Build and Ship
on: [push, pull_request]
# push:
# branches: [ "master" ]
# pull_request:
# branches: [ "master" ]
jobs:
build-linux:
name: build-${{ matrix.os }}-${{ matrix.cc }}
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.cc }}
strategy:
fail-fast: false
matrix:
cc: ["gcc", "clang"]
os: ["ubuntu-latest"]
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y libjansson-dev libsdl2-dev libsdl2-image-dev
# Remove this step when the github-hosted runner has an up-to-date SDL2
- name: Install newer SDL cmake config
run: sudo mkdir /usr/lib/x86_64-linux-gnu/cmake/SDL2_image/ && sudo wget -O /usr/lib/x86_64-linux-gnu/cmake/SDL2/sdl2-config.cmake zer0-one.net/sdl2-config.cmake && sudo wget -O /usr/lib/x86_64-linux-gnu/cmake/SDL2_image/sdl2_image-config.cmake zer0-one.net/sdl2_image-config.cmake
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE=Debug .
- name: Build
run: cmake --build .
# - name: Test
# run: ctest
- name: Create rpgng Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-${{ matrix.cc }}-rpgng-master
path: bin/*
if-no-files-found: error
retention-days: 1
build-macos-latest-clang:
runs-on: macos-latest
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install Dependencies
run: brew install jansson sdl2 sdl2_image
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE=Debug .
- name: Build
run: cmake --build .
# - name: Test
# run: ctest
- name: Create rpgng Artifact
uses: actions/upload-artifact@v3
with:
name: macos-latest-clang-rpgng-master
path: bin/*
if-no-files-found: error
retention-days: 1
build-windows-latest-msvc:
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install Dependencies
run: vcpkg install jansson:x64-windows sdl2:x64-windows sdl2-image:x64-windows python3:x64-windows
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake .
- name: Build
run: cmake --build . --config Debug
# - name: Test
# run: ctest -C Debug
- name: Create rpgng Artifact
uses: actions/upload-artifact@v3
with:
name: windows-latest-msvc-rpgng-master
path: bin/*
if-no-files-found: error
retention-days: 1
Formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install clang-format
run: sudo apt-get update && sudo apt-get install clang-format-15
- name: Run formatting
run: find . -name '*.h' -o -name '*.c' | xargs clang-format-15 -style=file -i
- name: Check formatting
run: git diff --exit-code
Pages:
needs: [build-linux, build-windows-latest-msvc, build-macos-latest-clang]
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y graphviz doxygen libjansson-dev libsdl2-dev libsdl2-image-dev
- name: Checkout source
uses: actions/checkout@v3
# Remove this step when the github-hosted runner has an up-to-date SDL2
- name: Install newer SDL cmake config
run: sudo mkdir /usr/lib/x86_64-linux-gnu/cmake/SDL2_image/ && sudo wget -O /usr/lib/x86_64-linux-gnu/cmake/SDL2/sdl2-config.cmake zer0-one.net/sdl2-config.cmake && sudo wget -O /usr/lib/x86_64-linux-gnu/cmake/SDL2_image/sdl2_image-config.cmake zer0-one.net/sdl2_image-config.cmake
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE=Release -DRPGNG_DOCS=ON .
- name: Build Docs
run: cmake --build .
- name: Create Docs Artifact
uses: actions/[email protected]
with:
path: docs/html/
- name: Publish Documentation
uses: actions/[email protected]